AT the end of another bleak year, a little bit of hope might emerge from an unlikely source.

A week today, the largest nation in Latin America votes in a seismic general election.

On one side stands Brazil’s incumbent leader Jair Bolsonaro, a gun-toting ultra-conservative who rails against the corresponding evils of socialism and “gender ideology”.

On the other stands Luiz Inacio Lula da Silva, the former leftist president and global progressive icon who is inching ever closer to an extraordinary political comeback.

A win for Lula would bring to an end four years of chaotic authoritarian rule that have weakened the pillars of Brazilian democracy.

A win for Bolsonaro would further menace Brazil’s social and sexual minorities, deepen its political divisions and dramatically – perhaps even irreversibly – escalate the climate crisis.

The good news is that, at this stage, Bolsonaro seems to be on the way out.

Lula has a 15-point lead in the first round of voting and a projected 17-point advantage in the second round – but it may not come to that.

Lula can win the election outright if he takes more than 50% of the vote on the first ballot.

Either way, the stakes in this contest are huge.

Bolsonaro won control of the presidency in 2018 in the wake of a sweeping corruption scandal – lava jato – that discredited much of the Brazilian political class.

Since then, he has governed from the hard right.

One of his first acts in office was to lift restrictions on gun ownership.

There are now more than 1.7 million private gun owners in Brazil, twice as many as there were in 2017.

He has also singled out gay people and trans groups as particular targets of his vitriol.

“If you want to come here and have sex with a woman, go for your life,” he told the Brazilian media in 2019.

“But we can’t let this place become known as a gay tourism paradise. We have families.”

Bolsonaro’s worldview is rooted in a kind of anti-communist paranoia.

He thinks urban leftists are out to destroy traditional Brazilian values and that socialism should be cleansed from the country via a swift dose of political violence.

An ex-army captain with an erratic disciplinary record, Bolsonaro has frequently praised the repressive military dictatorship that ran Brazil for two decades between 1964 and 1985.

“What would Brazil be without the works of the military government?” he remarked in April.

“It would be nothing: we would be a republiqueta (failed state).”

These anti-democratic gestures have intensified as polling day has approached.

IN August, Brazilian police raided the offices of several prominent Bolsonaro backers after a series of leaked WhatsApp messages suggested they were planning a coup d’etat in the event of a Lula victory.

Shortly after that, Bolsonaro himself said he would respect the outcome of the election, but only if the voting process was “clean and transparent.” (He has no reason to think it won’t be.) Bolsonarismo draws the bulk of its support from young men, evangelical Christians (of whom there are 65 million in Brazil), and rural agricultural interests.

But his political coalition is fracturing. His handling of Covid was a disaster.

When the pandemic first hit in 2020, Bolsonaro insisted that the virus would only infect elderly people and the infirm.

Then, much like his populist doppelganger Donald Trump, he said the disease could be treated with the anti-rheumatic drug hydroxychloroquine.

Then he left some of Brazil’s poorest communities to die by refusing to provide adequate supplies of oxygen to struggling provincial health services.

By the middle of 2021, Brazil had one of the highest Covid death tolls on earth, and the country’s poverty rates had skyrocketed.

After Covid, Bolsonaro – an administrative neophyte who spent most of his legislative career on the fringes of Brazil’s national congress – failed to revive the Brazilian economy.

Inflation is now running at 12%, growth has stalled, and many of the progressive social reforms enacted by Lula in the early 2000s have been scrapped or stripped back by conservative lawmakers.

As a result, Bolsonaro is staring down the barrel of a humiliating election defeat orchestrated by the Brazilian right’s ultimate ideological hate figure.

Lula is Bolsonaro’s opposite in pretty much every way. When Bolsonaro was serving the Brazilian military junta in the 1970s and 80s, Lula, then a trade union leader, was organising strikes and engaging in acts of public dissent against it.

Where Bolsonaro has sought to polarize Brazilian society, Lula has tried to unify it by emphasizing common themes like social justice and economic stability.

The diminutive ex-president certainly isn’t perfect.

His first presidency, which ran from 2003 to 2010, was a partial-success, marked by rising living standards associated with his historic bolsa familia spending programmes.

But he also presided over a culture of cronyism within his ruling centre-left Workers Party (PT).

In 2018, Lula became the highest profile casualty of the lava jato scandal, a far-reaching investigation that uncovered a deep network of kickbacks inside the Brazilian political system.

In late 2019, after 580 days behind bars, Lula’s (always heavily contested) graft conviction was quashed, and he shot straight back into the centre of Brazilian political life.

Now 76, Lula is a somewhat chastened version of his former self, eager (excessively so, some say) to placate Brazil’s economic elites and pull together a broad alliance capable of ending Bolsonaro’s reign.

In one notable gesture of conciliation towards his critics this summer, he appointed Geraldo Alckmin, a centre-right politician from Sao Paulo, to his presidential ticket.

The World Trade Organisation technocrat Roberto Azevedo has been cited as another prospective centrist addition to Lula’s cabinet.

AT the same time, Lula has been unequivocal about the need to heal the wounds of the Bolsonaro era.

If he wins the election, he will ditch the restrictive constitutional cap on public spending implemented in 2016 and – as part of a raft of redistributive measures aimed at making life more affordable for ordinary Brazilians – and introduce price controls on some essential goods.

Crucially, he will also reduce the size and scale of Amazonian deforestation.

In March, scientists at the University of Munich warned that biodiversity loss caused by industrial cattle farming and man-made wildfires “may already have pushed the Amazon close to a critical threshold of rainforest dieback”.

Once that threshold has been breached, the scientists said, vast amounts of carbon will be released into the atmosphere, accelerating the pace of planetary heating at a potentially uncontrollable rate.

Under Bolsonaro, the Amazon was treated, in purely instrumental terms, as a material resource to fire Brazilian economic growth.

From 2018 onwards, deforestation speeded up, reaching record levels in the first six months of this year.

Moreover, indigenous communities were brutally uprooted by land developers and mining companies operating with the implicit support of the Bolsonaro government.

Lula, by contrast, slashed deforestation rates during his first presidential term and has promised to make tackling the climate crisis an “absolute priority” if he is re-elected next month.

“We will put a complete end to any kind of illegal mining,” he said last month.

“We don’t need to cut down a single tree to raise [more] cattle.”

There is, of course, no guarantee that Lula will win the election on October 2. The polls could turn over the coming week. Or, as intimated, Bolsonaro could refuse to accept the result if he loses.

The spectre of military intervention also, always hangs over Brazil’s fractious constitutional democracy.

Bolsonaro has cynically encouraged such an intervention by inviting the armed forces to expand their – currently limited – role in supervising the voting process.

But at this late stage, will fascist wish fulfilment be enough to stop Lula? Probably not.

Brazilian democracy may be young, but it is also robust.

In April, Edson Fachin, the president of Brazil’s electoral court, said the country’s political and judicial institutions were on “high alert” for any prospective infringements ahead of the election.

And last month, a poll showed that more than two-thirds of Brazilian voters would fiercely oppose any return to military rule.

Bolsonaro’s last-ditch appeal to the generals was a sign of weakness, not strength. He is losing this election, and he knows it.

Brazil has a lot to gain from Bolsonaro’s defeat and Lula’s renaissance.

Then again, given the current global backdrop of conflict and climate chaos, the rest of us do too.