When it comes to standardized test results, whether it’s those from the National Assessment of Educational Progress (NAEP) or the Program for International Student Assessment (PISA), it’s no historical accident that Massachusetts performs near the top, one education expert says.

“The first public schools started in Massachusetts during the Colonial period,” said Tom Loveless, a senior fellow at the Washington, D.C.-based Brookings Institution, a think-tank that examines public policy issues. “There were about 3,000 in Massachusetts by the time of the American Revolution, and these were well-established institutions.”

In comparison, he said, the first public schools in Mississippi (the lowest performer on the 8th grade science NAEP test) and the South didn’t start until after the Civil War, as part of Reconstruction, a program that was supposed to change racial policies of the former Confederate States.

“Boston had all kinds of reasons why education was at the forefront [during Colonial times], said education historian William Reese, a University of Wisconsin professor. “It was a vital port and needed educated people who understood trade.

“Massachusetts’s political leaders believed in the power of education. In the South, however, there were laws against educating slaves,” he added, noting that many non-plantation-owning Southern whites weren’t educated, either.

The Bay State’s impetus for education, however, wasn’t business or careers. It was religion.

“[Massachusetts’s] first settlers were children of Europe’s Protestant Reformation, and literacy was of vital importance to them because it meant they could read the Bible in their own language and, thus, critical to salvation, as they saw it,” Reese said.

The Bay State’s first education laws were passed in the 1640s, says Peter Drummey, librarian at the Massachusetts Historical Society in Boston. In 1647, a law was referred to as “The Deluder Law,” stated that children needed to learn to read so they could read the Bible and protect themselves against “that old deluder, Satan.”

The 1647 law mandated that Massachusetts towns with 50 households hire someone to teach reading to the town’s children. If a town’s population increased to 100 households, the law demanded townsfolk start a grammar school that would prepare children to attend college.