A worker at a General Motors vehicle factory reacts during an assembly in Sao Jose dos Campos Aug. 26 that was held to vote on whether to accept or reject the company's proposal to furlough 930 workers for as long as five months. GM said the measure is aimed at adjusting production levels to weaker demand from Brazilian consumers. Reuters

Brazil’s economy slid into recession for the first time in more than five years, ahead of the October presidential election, as lower confidence eroded investment. Economic activity shrank by 0.6 percent from the first quarter to the second quarter, the Brazilian government’s statistics agency reported Friday.

Economists polled by Bloomberg had expected only a 0.4 percent quarter-to-quarter drop. Gross domestic product, the measure of all goods and services produced, fell 0.9 percent in the second quarter compared with the same period a year ago.

A 5.3 percent dip in investment drove the drop, although government spending also fell. Meanwhile, consumer spending remained weak, advancing just 0.25 percent in the second quarter after declining 0.2 percent in the first quarter.

The news comes after Latin America’s largest economy shrank by 1.5 percent in June, the fifth straight monthly decline and the worst since summer 2013, despite the tourism attracted by the World Cup. And growth in the first quarter was recently revised to a 0.2 percent fall from an initially estimated 0.2 percent rise.

The recession adds pressure on Brazil’s central bank to cut the required amount banks must hold rather than lend out or to reduce interest rates in an attempt to lower borrowing costs and put more spending power into businesses’ and consumers’ hands. It also puts pressure on President Dilma Rousseff, running for re-election, and her challengers Aécio Neves and Marina Silva to talk up economic reforms.

“We suspect that policy stimulus [from the central bank] would risk doing more harm than good,” Neil Shearing, chief emerging markets economist for Capital Economics, wrote in a research note Friday. “Instead, the key to reviving growth lies in whether the winner of October’s presidential election can implement much-needed reforms.”