Voters in Brazil on Sunday ousted President Jair Bolsonaro after just one term and elected the leftist former President Luiz Inácio Lula da Silva to replace him, election officials said, a rebuke to Mr. Bolsonaro’s far-right movement and his divisive four years in office.
The victory completes a stunning political revival for Mr. da Silva — from the presidency to prison and back — that had once seemed unthinkable.
It also ends Mr. Bolsonaro’s turbulent time as the region’s most powerful leader. For years, he attracted global attention for policies that accelerated the destruction of the Amazon rainforest and exacerbated the pandemic, which left nearly 700,000 dead in Brazil, while also becoming a major international figure of the far right for his brash attacks on the left, the media and Brazil’s democratic institutions.
More recently, his efforts to undermine Brazil’s election system drew particular concern at home and abroad, as well as worldwide attention to Sunday’s vote as an important test for one of the world’s largest democracies.
Without evidence, the president has criticized the nation’s electronic voting machines as rife with fraud and suggested he might not accept a loss, much like former President Donald J. Trump. Many of his supporters vowed to take to the streets at his command.
As of 11 p.m. local time on Sunday night, Mr. Bolsonaro had not publicly commented on the election’s outcome. The questions of whether he would concede and when remained unclear.
The results on Sunday showed that tens of millions of Brazilians had grown tired of his polarizing style and the frequent turmoil of his administration. It was the first time an incumbent president failed to win re-election in the 34 years of Brazil’s modern democracy.
Still, Mr. da Silva won with the narrowest margin of victory over that same period, signaling the deep divide that he will confront as president.
He won 50.90 percent of the votes, versus Mr. Bolsonaro’s 49.10 percent with 99.98 percent of the vote counted Sunday night.
“I will govern for 215 million Brazilians, and not just for those who voted for me,” Mr. da Silva said in his victory speech Sunday night, reading from pages held by his new wife, whom he married this year. “There are not two Brazils. We are one country, one people, one great nation.”
Mr. da Silva, 77, a former metalworker and union leader with a fifth-grade education, led Brazil during its boom in the first decade of the century, but he was later convicted on corruption charges after he left office and spent 580 days in prison.
Last year, the Supreme Court threw out those convictions, ruling that the judge in his cases was biased, and voters rallied behind the man known simply as “Lula.”
Mr. da Silva’s election brings an end to a presidential race that was widely regarded as one of the most important votes in Latin America in decades, a match between perhaps Brazil’s two biggest living political figures, with starkly different visions to reverse the country’s fortunes.
His victory also pushes Brazil back to the left, extending a string of leftist victories across Latin America, fueled by a wave of anti-incumbent backlash. Six of the region’s seven largest countries have now elected leftist leaders since 2018.
Despite his victory, a sizable portion of Brazil’s 217 million people still view Mr. da Silva as corrupt because of the vast government kickback scheme uncovered years after he left office. And while his corruption convictions were nullified, Mr. da Silva was never ruled innocent.
Yet, amid those flaws, the strong opposition to Mr. Bolsonaro and his far-right movement was enough to carry Mr. da Silva back to the presidency.
“He’s not the solution to every problem. But he’s our only hope,” said Stefane Silva de Jesus, a 30-year-old librarian, after she cast her ballot for Mr. da Silva in Rio de Janeiro.
He is set to take office on Jan. 1.
Flávia Milhorance and Ana Ionova contributed reporting from Rio de Janeiro, André Spigariol from Brasília and Laís Martins from São Paulo.
(With files from The New York Times)