American students once again lag behind many of their Asian and European peers on a global exam, a continuing trend that often is blamed on child poverty and a diverse population in U.S. schools.

Education Secretary Arne Duncan called the results a “picture of educational stagnation” as U.S. students showed little improvement over three years, failing to score in the top 20 on math, reading or science.

Students in Shanghai, China’s largest city, had the top scores in all subjects, and Singapore, South Korea, Japan and Hong Kong students weren’t far behind. Even Vietnam, which had its students participate for the first time, had a higher average score in math and science than the United States.

These results again raise the question of whether the United States is consistently outperformed because of the widely varied backgrounds of its students. Some are from low-income households, for example. Others don’t have English as their primary language.

But some countries that outperform the United States also experience such challenges.

“Americans have got a thousand reasons that one country after another is surpassing our achievement, and I have yet to find a good excuse,” said Marc Tucker, president of the National Center on Education and the Economy.

About half a million students in 65 nations and educational systems took part in the 2012 Program for International Student Assessment, or PISA, which is coordinated by the Paris-based Organization for Economic Cooperation and Development.

Most results come from a sampling of scores from countries as a whole, but in China it was given in select regions.

The Education Department’s National Center for Education Statistics released the results. The test, given every three years to 15-year-olds, is designed to assess students’ problem-solving skills.

U.S. scores on the PISA haven’t changed much since testing started in 2000, even as students in countries such as Ireland and Poland have shown improvement and surpassed U.S. students.

In Britain, scores were about the same as three years ago, prompting debate about why the country has not improved despite increased spending on education. The nation did better than the United States in math and science but was not among the top performers in any subject.

“Since the 1990s, our performance in these league tables has been at best stagnant, at worst declining,” said Britain’s Education Secretary Michael Gove, adding that the results “underline the urgent need for our reforms.”

Gove’s ruling Conservative Party and the opposition Labour Party both blamed each other’s policies for the results.

A business organization said Britain has fallen behind in part because of “historic complacency” and a lack of focus on achievements and results compared to Asian countries.

“Countries with an unrelenting focus on the quality and rigor of their education system will be the ones who win,” said Mike Harris at the Institute of Directors.

Duncan, too, called for an increased focus on education.

“We must invest in early education, raise academic standards, make college affordable and do more to recruit and retain top-notch educators,” he said.

Tom Loveless, a senior fellow at the Brookings Institution, cautions about reading too much into the results from Shanghai, which also dominated the test in 2009. The students tested are children of the elite. They are the ones allowed to attend municipal schools because of restrictions such as those that keep many migrant children out, he said.

“The Shanghai scores, frankly to me, are difficult to interpret,” Loveless said. “They are almost meaningless.”

But Jack Buckley, commissioner of the National Center for Education Statistics, said U.S. officials have not seen any evidence of a “biased sample” of students tested in Shanghai. If the entire nation was included, he said it’s unclear what the results would show.

Tucker said Shanghai has worked hard to bring migrant children into its schools and has put an emphasis on improving teacher quality — a factor helping to drive its test scores.

In the education community, Finland has drawn notice for its past test performance, but this year its average PISA score dropped in all three subjects, most pronounced in math. Finland’s students did better on average than those from the United States.