With China’s debut in international standardized testing, students in Shanghai have surprised experts by outscoring their counterparts in dozens of other countries, in reading as well as in math and science, according to the results of a respected exam.

American officials and Europeans involved in administering the test in about 65 countries acknowledged that the scores from Shanghai — an industrial powerhouse with some 20 million residents and scores of modern universities that is a magnet for the best students in the country — are by no means representative of all of China.

About 5,100 15-year-olds in Shanghai were chosen as a representative cross-section of students in that city. In the United States, a similar number of students from across the country were selected as a representative sample for the test.

Experts noted the obvious difficulty of using a standardized test to compare countries and cities of vastly different sizes. Even so, they said the stellar academic performance of students in Shanghai was noteworthy, and another sign of China’s rapid modernization.