President Obama visits Thomas Jefferson High School for Science and Technology in Fairfax County, Va., in 2011 as students Meghan Clark and Nathan Hughes demonstrate robotic technology. (Pablo Martinez Monsivais/AP)

Thomas Jefferson High School for Science and Technology, a selective public school in Northern Virginia, led the nation this year in the number of perfect scores achieved on Advanced Placement exams.

TJ, as the school is known, notched six AP perfect scores — two each on tests in computer science, Spanish, and U.S. government and politics.

The College Board, which runs the AP program, said three high schools recorded five perfect scores: Carmel in Indiana, Lane Technical in Illinois and Southwest Miami in Florida.

To get a top score on an AP exam — a 5 on the 5-point scale — is a significant achievement that often enables students to get college credit. To get a perfect score is a rarity.

Of 163,405 students who took the Spanish language and culture exam in May, 108 got every answer right. There were 25 perfect scores in U.S. government and politics, out of 296,778 test takers, and 10 in computer science, out of 58,141.

TJ Principal Evan Glazer, told of the school’s achievement, said: “I give a lot of credit to the teachers and of course the students who work their tails off to do their very best.”

The 1,800-student school, which draws top talent from across the region, is a perennial national power in academics. Glazer said the average TJ student will take eight AP tests before graduating. The identities of those who received perfect scores this year were not publicly disclosed.

Glazer cautioned that perfection is not the school’s goal. “The real benefit of a school like TJ is not pursuing perfection but instead taking hold of questions that have unknown answers and being very comfortable with imperfection in the pursuit of innovation,” he said.

“If you’re getting everything right all the time, then a student may very well be bored,” Glazer said. He said he prefers to give students an opportunity to “face some setbacks, learn from their mistakes, be able to see their growth.”