(Bloomberg) -- Indonesia’s economy in the second quarter snapped a year of contractions as a temporary relaxation of virus curbs benefited consumption and investment -- but before restrictions were recently tightened anew.

Gross domestic product rose 7.07% from a year ago, the statistics bureau announced Thursday. That was the fastest pace since 2008, according to data compiled by Bloomberg, and beat the median estimate of 6.72% in a survey of 23 analysts.

“The number is obviously flattered by base effect from last year’s deep slump, but nonetheless signals a fairly strong recovery momentum in April and May especially, before the pandemic resurgence hit Indonesia significantly,” said Wellian Wiranto, an economist at Oversea-Chinese Banking Corp. in Singapore. “It also offers hope that, should Indonesia manage to get the pandemic under better control, the underlying momentum can recover quite well.”

The Jakarta Composite Index was up 0.7% and the rupiah edged down 0.2% to 14,345 to the dollar after the figures were announced.

Indonesia had seen four straight quarters of contraction, including the first three months of 2021, when GDP shrank a revised 0.71%. Economic growth was 3.31% in April-June compared to the previous quarter on a non-seasonally adjusted basis, higher than the 2.69% estimated by economists.

Southeast Asia’s largest economy now must sustain growth while grappling with one of the worst Covid outbreaks in the world. Movement restrictions were raised to their highest level last month to halt a record increase in infections and fatalities from the delta variant.

Any recovery will be challenged by mobility restrictions that are weighing on household consumption. The government recently cut its 2021 GDP outlook to 3.7%-4.5%, from earlier forecasts of 4.5%-5.3%, while the Asian Development Bank and the International Monetary Fund also have downgraded the outlook.

Still Challenging

Wiranto said OCBC was lowering its full-year growth forecast to 3.7%, from 4.1% before.

“While the improving Covid-19 situation in Jakarta offers some hope for reopening, the still-challenging conditions outside of Java and Bali in particular point to a downbeat third quarter,” he said.

Consumption and industry activity were relatively robust in the second quarter due to curbs that were temporarily relaxed and spending around religious holidays, with retail sales surging and manufacturing still expanding. With curbs recently reinstated amid new outbreaks, these indicators are beginning to show fresh weakness.

Major cities will remain under the strictest curbs until Aug. 9, with the government shifting its goal from achieving herd immunity to controlling the pandemic.

Some sector details in the second quarter, in year-on-year terms, include:

  • Private consumption +5.93%
  • Government spending +8.06%
  • Gross fixed capital formation +7.54%
  • Transportation and warehousing +25.1%
  • Accommodation and food and beverage +21.6%
  • Exports +31.78%, imports +31.22%

Nicholas Mapa, an ING Groep NV economist, warned that the second-quarter bounce would likely be “short-lived” given the return to partial lockdowns. Annual GDP growth will likely decelerate in the July-September period and shrink on a quarterly basis, and early manufacturing indicators are already showing a decline, he said.

(Updates with more details throughout.)

©2021 Bloomberg L.P.