Household consumption, relatively resilient throughout the slowdown, gained in the second quarter as people spent more money at the start of the Muslim fasting month, which this year began in June.

Government spending rose too, helping lift growth in the second quarter. But investment remained soft, growing slower on a yearly basis in the second quarter compared to the first.

Rate cut ahead?

Rangga Cipta, an economist with Samuel Sekuritas in Jakarta, said growth is now closer to the economy's potential and he expects it to accelerate in coming quarters, helped by at least another 25 basis point cut to Bank Indonesia's benchmark rate.

"While we think the worst for Indonesia's economy is now over, a combination of fiscal tightening and low commodity prices will keep growth stuck at around 5 percent over the next couple of years," it said.

The central bank this year has cut its benchmark four times totalling 100 basis points. It is adopting a new policy rate this month in a bid to get banks to lower credit rates more quickly.

To fill a widening budget deficit and boost growth, the government is counting on a tax amnesty, offering low rates for taxpayers to come clean with undeclared income.

Bank Indonesia Governor Agus Martowardojo has said money returning home under the amnesty can help the economy expand in 2017 at the higher end of its 5.2-5.6 percent projected range.