Brazil's economy performed worse than expected in the second quarter of 2021, contracting 0.1 percent in the latest sign the Latin American giant's pandemic recovery has lost steam.

Analysts had forecast growth of around 0.2 percent, but the economy appeared to take a hit from high unemployment, surging inflation and a bad drought that is raising concerns about electricity supply from crucial hydropower plants.

The reversal from the first quarter's surprisingly strong 1.2 percent growth is bad news for President Jair Bolsonaro as he battles slumping popularity in the build-up to elections in October next year.

Hit hard by the drought in the south and central-west, the agribusiness sector registered the worst output contraction for the April-June period, shrinking 2.8 percent, said the national statistics institute, IBGE.

Industry retreated 0.2 percent, while the service sector expanded 0.7 percent, it said.

Analysts had been upbeat on Latin America's biggest economy after Brazil's better-than-expected first quarter.

But the outlook has recently turned bleaker, with unemployment stubbornly high at 14.1 percent, inflation soaring to 8.99 percent -- well above the central bank's target ceiling of 5.25 percent -- and the worst drought in nearly a century fueling fears that electricity shortages could be on the horizon.

Brazil depends on hydro power for around two-thirds of its electricity capacity. But low water levels mean its dams produce less energy.

That has forced the national electricity agency, ANEEL, to hike customers' rates in a bid to curb consumption.

However, the sharp rise in electric bills -- with an average increase of 6.78 percent predicted for September -- is only fueling other price increases, economists say.

Unemployment has soared in Brazil due to the coronavirus pandemic
Unemployment has soared in Brazil due to the coronavirus pandemic AFP / NELSON ALMEIDA

The situation has left economic policy makers with no good options.

"We're seeing high inflation across the board, which is forcing the central bank to raise interest rates.... But that makes the economy slow down," said Paula Magalhaes, chief economist at consulting firm A.C. Pastore & Associados.

Uncertainty over the impact of the coronavirus Delta variant on the country with the world's second-highest Covid-19 death toll -- 580,000 -- is also weighing on the economy.

Analysts polled by the central bank are currently forecasting Brazil's economy will grow 5.22 percent this year, after shrinking 4.1 percent in 2020, battered by the pandemic.

With the weak second-quarter growth figure, this year's outlook is now likely to be revised down again, said Etore Sanchez, chief economist at Ativa Investimentos.

"This contraction surprised the market," he said.

"We're not really seeing any big recovery in the economy. It's going to be very gradual and slow."

The weakening economy could hurt Bolsonaro, whose approval rating has fallen to the lowest of his term, 23 percent, according to a poll last month by XP/Ipespe.

In a poll released Wednesday, another firm, Quaest, found the far-right leader is on track to lose his bid for re-election in October 2022 with 30 percent of the vote, to 55 percent for leftist ex-president Luiz Inacio Lula da Silva.

In the build-up to the vote, Bolsonaro has been attacking the integrity of Brazil's electronic voting system, insisting it is plagued by fraud, and railing against what he sees as a hostile judiciary.

That has ratcheted up the tension in Brazil, adding to the environment of uncertainty.

A "negative feedback loop between inflation, fiscal risk and politics is undermining growth," consulting firm Eurasia Group said in a note.