BOSTON — Massachusetts has the best public school system in the country but could do more to help low-income students, according to a new report that ranks states by the quality of their public schools.

Education Week’s annual national report, Quality Counts, gave Massachusetts the top spot because it has the nation’s top fourth- and eighth-grade reading and math scores, high postsecondary degree attainment and rising AP test scores.

Massachusetts has ranked No. 1 every year since the index began in 2008.

Mitchell Chester, commissioner of elementary and secondary education, said he’s “very proud” of the ranking.

“We’ve focused on doing well; we’ve focused on aiming high in terms of our academic expectation,” said Chester. “Our educators have done the smart, hard work that has put us at the top.”

Massachusetts ranked first in two of the three criteria Education Week’s grading system considers: students’ chance of success (based on everything from family income to outcomes after school) and K-12 achievement levels. In school finances, however, it scored significantly lower because of the disparity between richer and poorer districts.

According to the report, Massachusetts fourth- and eighth-grade students’ test scores have improved at higher rates than the national average since 2003, in all but one area. Eighth-grade reading scores improved, but at a lower rate than the national average.

Despite the state’s high overall ranking, the report shows that Massachusetts is still plagued by one of the highest poverty-based school achievement gaps in the nation.

While Massachusetts students score well in general, many low-income students don’t test as well as more affluent peers.

“As well as we’ve done in Massachusetts, there are many students, too many students, who are not enjoying the level of success that most students are enjoying,” Chester said.

Boston Teachers Union President Richard Stutman says achievement gaps along poverty lines is the most pressing issue on teachers’ minds.

“It is the most striking thing that we deal with every day,” said Stutman.

In eighth grade, poverty-based achievement gaps expanded to more than 25 points in reading and more than 30 points in math in 2015 — a bigger difference than in 2003, the report says.

“The achievement gaps come from opportunity gaps,” said Rosann Tung, director of research and policy for the Annenberg Institute for School Reform. “And opportunity gaps are found in most urban districts. They are usually aligned with race and class.”

In 2015, Massachusetts received the highest ranking on national fourth- and eighth-grade reading and math tests, but the achievement gap there between low-income students and peers was the third highest in the nation.

“If you’re basing these kinds of findings on test scores, they’re usually correlated with income and education level,” Tung said.

School spending in Massachusetts also contains large gaps.

Average per-pupil spending in the state is about $15,000. But the range is wide: Six districts spend more than $25,000 per pupil, while seven spend less than $11,000. Only eight states have a greater disparity, the report found.

With the recent passage of the national education law, the Every Student Succeeds Act, Massachusetts may have more control over its future success. The new law gives states more responsibility for intervening in low-performing schools — and supporting historically overlooked students, including low-income and minority students.

With the new responsibility comes more leeway. The state will now be able to rate and hold schools accountable on measures of quality that go beyond test scores, such as students’ emotional wellness, school safety, educator engagement or attendance.

Related: