Students preparing to leave high school are faring no better in reading or math than their peers four decades ago, the government said Thursday. Officials attributed the bleak finding to more lower-performing students staying in school rather than dropping out.

The news was brighter for younger students and for blacks and Hispanics, who had the greatest gain in reading and math scores since the 1970s, according to the National Assessment of Educational Progress, commonly referred to as the Nation’s Report Card.

“In some ways, the findings are full of hope. Today’s children ages 9 and 13 are scoring better overall than students at those ages in the early ’70s,” said Brent Houston, principal of the Shawnee Middle School in Oklahoma and a member of the National Assessment Governing Board, which administers the tests.

But he also noted challenges for older students.

“There is a disturbing lack of improvement among 17-year-olds. Since the early 1970s, the average scores of 17-year-olds in both reading and mathematics have remained stagnant,” he said.

The report says that in reading, today’s 9- and 13-year-olds are outperforming students tested in 1971, when that skill was first tracked. They also did better in math, compared with students in 1973, the initial measurement.

Officials suggest the results for 17-year-old students reflect fewer low-performing students dropping out.

For instance, Hispanic students had a 32 percent dropout rate in 1990 and that number fell to 15 percent in 2010, said Peggy Carr, an associate commissioner with the National Center for Education Statistics.

“These students are generally scoring at the lower end of the distribution but it’s a good thing that they’re staying in schools,” Carr said.

Even so, they’re still not learning more despite increased education spending.

“Today’s results are the nation’s education electrocardiogram and show positive results for the early grades and increased performance by students of color, but the nation’s high school students are in desperate need of serious attention,” said Bob Wise, president of the Alliance for Excellent Education and former governor of West Virginia.

“Today’s economic trends show the rapidly growing need for college- and career-ready students. These results show that most of the nation’s 17-year-olds are career ready, but only if you’re talking about jobs from the 1970s,” he added.

Black and Hispanic students at all ages narrowed the performance gap with white students, according to the report.

Among 17-year-old students, the gaps between black and white students and between Hispanic and white students were cut by half.

In math, 9-year-old black and Hispanic students today are performing at a level where black and Hispanic 13-year-olds were in the early 1970s.

“Black and Hispanic children have racked up some of the biggest gains of all,” said Kati Haycock, president of the Education Trust, an advocacy organization. “These results very clearly put to rest any notion our schools are getting worse. In fact, our schools are getting better for every group of students that they serve.”

The overall composition of classrooms is changing as well.

Among 13-year-old students, 80 percent were white in 1978. By 2012, that number fell to 56 percent. The number of Hispanics roughly tripled from 6 percent in 1978 to 21 percent in 2012.

“Over a 40-year period, an awful lot changes in our education system,” said Jack Buckley, the chief of the National Center for Education Statistics.