Public school students across the United States posted record scores in math this year but their progress stalled in reading, according to results of nationwide testing released Tuesday.

In math, 40 percent of fourth-graders and 35 percent of eighth-graders scored at a level that was proficient or advanced, higher than at any time since National Assessment of Education Progress (NAEP) testing began 20 years ago.

In reading, 34 percent of fourth-graders and eighth-graders scored at a level that was proficient or advanced. That performance was unchanged for fourth-graders since the test was last given in 2009 but was slightly better for eighth-graders.

The tests, often referred to as the nation’s report card, also showed minimal progress in narrowing the achievement gap between white students and their black and Latino counterparts, despite nearly 10 years of federal law designed to close that margin.

“The modest increases in NAEP scores are reason for concern as much as optimism,” Education Secretary Arne Duncan said. “While student achievement is up since 2009 in both grades in mathematics and in eighth-grade reading, it’s clear that achievement is not accelerating fast enough for our nation’s children to compete in the knowledge economy of the 21st century.”

The standardized math and reading tests, administered by the U.S. Education Department, were given this year to a representative national sample of about 422,000 fourth-graders and 343,000 eighth-graders.

The tests have been given every two years since the early 1990s and offer educators, parents and policymakers a sense of how the nation’s students are progressing over time.

Locally, students in the District performed better in math in grades 4 and 8 compared with the school system’s average scores in 2009 and 1992.

But District students still lagged behind the national average in both grades. On the 500-point scale used in the math assessment, D.C. fourth-graders averaged 222, compared with a national average of 240. District eighth-graders averaged 260, lower than the 283 average score for students across the country.

District scores reflected both traditional and public charter students.

D.C. Schools Chancellor Kaya Henderson said she was hesitant to read much into the scores until she sees more detailed data that will be released next month. But she said Tuesday’s results were consistent with the annual tests administered by the school system, which have shown growth in secondary math and flat or declining scores in reading.

“This continues to bear out where we need to do the most work,” she said, adding that it validates the decision to make literacy the first piece of a planned overhaul of the District’s academic plan. The strategy calls for more teacher training in reading instruction and an effort to embed literacy skills in all subjects in elementary and middle schools.

Still, the NAEP scores show the District was among just four places — including Hawaii, New Mexico and Rhode Island — that saw increases in math in both grades since 2009. In reading, Hawaii and Maryland had increases in both grades. Hawaii was the only state to post higher scores in both subjects and both grades.

“We are on the right track in many respects, but we have a long way to go,” said Bill Reinhard, a spokesman for Maryland’s Education Department. He said the state was continuing to increase instructional rigor, particularly in math.

In Virginia, the average reading scores for fourth-graders and eighth-graders remained unchanged compared with 2009. Average math scores for both grades also were not statistically different from two years ago. In both subjects and in both grades, Virginia students outpaced the national average.

Virginia will implement new English standards in the next school year that will emphasize comprehension, vocabulary and research. “As schools implement these more challenging standards, it is my expectation that the reading performance of Virginia eighth-graders on the NAEP will improve,” Superintendent of Public Instruction Patricia I. Wright said in a statement.

Federal officials who oversee the testing said they don’t have enough information to suggest factors behind the scores.

But Sean P. “Jack” Buckley, the commissioner of the National Center for Education Statistics, said that demographic changes — such as an increase in students for whom English is a second language — might explain why overall reading scores remain flat. “That’s a plausible argument,” Buckley said. “But we would need a great deal of additional measurement.”

Overall, public schools have seen a drop in the number of white students and an increase in black, Hispanic and Asian students. The number of students eligible for free or reduced-price lunch — a yardstick that educators use to measure the number of children coming from poor households — also has increased.

For the first time, the test’s creators reported separate data for Asians and Pacific Islanders. Asian students scored higher than any other group, including whites, in reading and math.

Staff writer Bill Turque contributed to this report.