Students Niko Bartash, 11th grade, left; Ulysses Campbell, 12th grade, second left; and Max Cooper, 11th grade, second right; touch a plasma globe in the Advanced Placement Physics class at Woodrow Wilson High School in Washington on Feb. 7. (Charles Dharapak/AP)

For the eighth consecutive year, Maryland had the highest percentage of high school seniors in the country pass Advanced Placement tests in 2013.

Nearly 30 percent of Maryland’s seniors earned a college-ready score of 3 or better on the tests, according to a report released by the College Board on Tuesday. The tests — which range from the arts to world languages across more than 30 subjects — aim to give students a taste of work at the college level, and those who pass them can earn college credit while still in high school.

Connecticut ranked second in 2013, and Virginia followed closely behind in third place, with more than 28 percent of its graduates obtaining a 3 or better on the tests, which are graded on a scale of 1 to 5.

The District — which is difficult to compare to states because it has an entirely urban school system — saw the number of students who pass at least one AP exam climb more than 50 percent since 2010. The city led the nation for its proportion of test-takers who passed at least one AP test and are African American; almost 34 percent of District seniors who passed an AP exam in 2013 were black — down from 42 percent the year before but still well above the national average of 4.6 percent.

Educators said the annual AP report highlights the challenges that school systems across the country continue to face in closing the achievement gap. Thirty states had more African American students taking exams and passing them, but the national gains over the past year inched up only slightly.

For example, 11.7 percent of Maryland’s high school seniors who passed an AP test last year were black, up from 11.4 percent the previous year. The number in Virginia increased by 0.3 percent, from 7.4 to 7.7 percent.

“Maryland schools are focused on preparing our graduates for higher education or career, and the AP program provides students with a strong foundation upon which to build,” Maryland Superintendent of Schools Lillian M. Lowery said in a statement. “Our students continue to make steady progress, but there is plenty of room for improvement. We must eliminate gaps in achievement between student subgroups, making certain all our students have the best opportunities.”

Maryland and Virginia exceeded the overall national passing rate of 20.1 percent.

Maryland Gov. Martin O’Malley (D) said the report is evidence that the state’s commitment to education is “paying off” and Virginia Gov. Terry McAuliffe (D) said the report shows Virginia is a “national leader in preparing our students for college or to join the workforce in a high demand field.”

The report also found that there are more test-takers nationwide and that a higher number of them are showing success.

The number of U.S. students who graduate from high school and have taken an AP course has nearly doubled over the past decade, and the number of low-income students taking AP has more than quadrupled, according to the report.

In Prince George’s County, the number of students taking AP exams increased by more than 7 percent in 2013, and the number of tests with a score of 3 or higher increased by 6.5 percent.

“This is good news and it demonstrates that we are moving towards our goal of ensuring that students graduate college- and career-ready,” said Schools Chief Executive Officer Kevin Maxwell in a statement.

In the District, 14 percent of graduating seniors from the District’s traditional and charter schools passed an AP exam while in high school, continuing a decade of steady improvement, but still trailing the national average.

“We still have work to do, but with more students taking these classes and passing the AP exam every year, we are helping our students prepare for the academic demands of college and changing the culture at our schools,” Chancellor Kaya Henderson said in a statement.

In Montgomery County, more than half of the graduates earned a 3 or better on at least one AP exam, outperforming students across the state and the country, county officials said.

Jenna Johnson, Michael Alison Chandler, Donna St. George, and T. Rees Shapiro contributed to this article.