JAKARTA - Indonesia pulled out of recession in the second quarter after reporting its strongest annual growth rate in more than a decade, but analysts warned its economic recovery will suffer a setback due to a recent surge in COVID-19 infections.

Southeast Asia's largest economy grew 7.07% in the April-June quarter compared with a year earlier, its first expansion in five quarters, Statistics Indonesia reported on Thursday.

The pace was stronger than the 6.57% growth expected in a Reuters survey of analysts, and the highest since the October-December quarter of 2004, according to Bank Mandiri data. The first quarter's contraction was revised to 0.71%.

Transportation and warehousing as well as food and beverage sectors reported the biggest growth, in line with people's increasing mobility during the period, the statistics chief Margo Yuwono said in a news conference.

However, he said the high growth rate was also due to low base effects when compared to the weak pandemic-stricken second quarter last year, noting countries such as Singapore and the United States have reported a similar pattern.

On a quarterly, non-seasonally adjusted basis, the economy grew 3.31%, compared with a revised 0.92% drop in January-March. Analysts had expected 2.94%.

Indonesia's gross domestic product (GDP) shrank last year for the first time since 1998, by 2.1%, as its COVID-19 outbreak and mobility curbs to contain the coronavirus hit nearly all aspects of economic activity.

To help the economy weather the crisis, the government has spent tens of billions of dollars, while the central bank implemented unorthodox measures such as directly financing the fiscal deficit to complement its interest rate cuts.

However, COVID-19 cases had spiked starting in June, driven by the spread of the Delta variant, and authorities imposed a new round of restrictions since early July.

"This inevitably will adversely impact the recovery progress," Bank Mandiri's economist Faisal Rachman said.

(Reporting by Gayatri Suroyo, Fransiska Nangoy, Tabita Diela; Editing by Kim Coghill) ((gayatri.suroyo@thomsonreuters.com; +622129927609; Reuters Messaging: gayatri.suroyo.thomsonreuters.com@reuters.net))