TOKYO (AP) — Japan’s economy grew at an annual rate of 2.2% for the April-June quarter from the previous quarter, the government said Monday, as consumer spending rebounded with COVID-19 restrictions getting gradually lifted.

Japan’s gross domestic product, or GDP, the sum of the value of a nation’s products and services, expanded 0.5% from January-March, during which the economy had stayed flat, according to the Cabinet Office’s preliminary estimates.

Economists had forecast 0.6% on-quarter growth.

The annual numbers show how the economy would have grown if the quarterly rate were to continue for a year.

Private consumption jumped at an annual rate of 4.6%. Public investment rose at an annual rate of 3.8%. Exports gained 3.7%, while imports grew 2.7%, both annual rates.

One major risk for the world’s third-largest economy has been higher prices, especially in the energy sector, brought on by global inflation. Russia’s war in Ukraine has pushed already high energy prices still higher, a major negative for resource-poor Japan.

The Japanese yen has weakened to two-decade lows against the dollar, recently trading at about 135 yen to the dollar, making imports relatively more expensive. After the release of GDP data, the dollar was trading at about 133 yen.

On the plus side, the weak yen works as a plus for Japan’s giant exporters like Toyota Motor Corp. by boosting the value of overseas earnings when translated into yen.

The coronavirus pandemic is another factor. Japan’s last government-backed restrictions to try to curb infections ended in March.

COVID-19 cases have surged dramatically in recent months to record highs in some areas — a jump attributed to the greater availability of tests, more transmissible variants, and a segment of the population being under-vaccinated despite the shots being readily available.

Some analysts think Japan’s economic growth will drop again in the July-September period.

“After a much brighter spring, we think the economy will slow again this quarter on the back of weaker consumer spending due to rising COVID-19 infections,” said Takayuki Toji, an economist at SuMi TRUST.

“Exports should be supported by the lifting of the urban blockade in China and capital investment should remain firm but slowing global growth due to monetary tightening in the U.S. and Europe will take its toll.”