Indonesia's economy grew by 5.11% in the first quarter from a year earlier, the highest in three quarters and slightly faster than expected, bolstered by spending for the country's general election, data from the statistics bureau showed on Monday.

Economists polled by Reuters had expected Indonesia to post annual growth of 5% in the January-March period. Annual growth in the fourth quarter was 5.04%.

Southeast Asia's largest economy has taken a hit from declining commodity exports in the past year. The resource-rich country is the world's biggest exporter of thermal coal, palm oil and nickel, among other commodities.

But in the January-March quarter, campaign expenditure for the Feb. 14 election and higher household spending during the Muslim holy month of Ramadan, which started in March, bolstered economic activity.

Government spending jumped nearly 20% annually in the first quarter, versus a growth rate of just 2.81% in the previous three months.

Household spending grew 4.91% on a yearly basis, compared to a 4.47% expansion in the previous quarter. Household consumption makes up over half of Indonesia's GDP.

Investment growth, however, slipped to 3.79% in January-March, from 5.02% in the fourth quarter.

The first-quarter growth rate was slower than the government's forecast of 5.17%. For 2024, the government is targeting growth of 5.2%, up from 5.05% last year.

(Reporting by Stefanno Sulaiman, Gayatri Suroyo and Fransiska Nangoy; Editing by John Mair and Sonali Paul)