TOKYO—The Japanese economy shrank less than the U.S. and European economies did in the April-June quarter, but it fared worse than Asian counterparts.

Japan’s gross domestic product fell 7.8% in the second quarter of 2020 compared with the previous quarter, the worst drop on record in the period since 1980, when comparable data began to be available. The contraction was sharper than the previous record of minus 4.8% in January-March 2009 after the global financial crisis.

The result was in line with expectations after the new coronavirus forced many retailers and other businesses to close during a state of emergency in April and May and blocked virtually all foreign tourists from visiting Japan.

Japan, the world’s third largest economy after the U.S. and China, fared better than Western peers. The U.S. economy shrank 9.5% in the quarter, while major European economies generally shrank more than 10%, including a 20% drop in the U.K.

Elsewhere in Asia, signs of recovery have emerged earlier. In China, where the virus was largely quelled by March, GDP in the second quarter rose 11.5% compared with the previous quarter, while South Korea’s GDP fell 3.3% in the quarter.