SAO PAULO (AP) -- Brazilians delivered a very tight victory to Luiz Inácio Lula da Silva in a bitter presidential election, giving the leftist former president another shot at power in a rejection of incumbent Jair Bolsonaro's far-right politics.
Da Silva received 50.9% of the vote and Bolsonaro 49.1%, according to the country's election authority. Yet hours after the results were in -- and congratulations poured in from world leaders -- Bolsonaro had yet to publicly concede or react in any way.
Bolsonaro's campaign had made repeated -- unproven -- claims of possible electoral manipulation before the vote, raising fears that, if he lost, he would not accept defeat and try to challenge the results.
For da Silva, the high-stakes election was a stunning comeback. His imprisonment for corruption sidelined him from the 2018 election won by Bolsonaro, who has used the presidency to promote conservative social values while also delivering incendiary speeches and testing democratic institutions.
"Today the only winner is the Brazilian people," da Silva said in a speech Sunday evening at a hotel in downtown Sao Paulo. "It's the victory of a democratic movement that formed above political parties, personal interests and ideologies so that democracy came out victorious."
Da Silva is promising to govern beyond his party. He says he wants to bring in centrists and even some leaning to the right, and to restore the kind of prosperity the country enjoyed when he last served as president from 2003-2010. Yet he faces headwinds in a politically polarized society.
Bolsonaro's four years in office have been marked by proclaimed conservatism and defense of traditional Christian values. He claimed that his rival's return to power would usher in communism, legalized drugs, abortion and the persecution of churches - things that didn't happen during da Silva's earlier eight years in office.
This was the country's tightest election since its return to democracy in 1985, and the first time that a sitting president failed to win reelection. Just over 2 million votes separated the two candidates; the previous closest race, in 2014, was decided by a margin of roughly 3.5 million votes.
Da Silva's win extended a wave of recent leftist triumphs across the region, including Chile, Colombia and Argentina.
The president-elect will inherit a nation straining against itself after he is inaugurated on Jan. 1, said Thomas Traumann, an independent political analyst who compared Sunday's results to Biden's 2020 victory.
"The huge challenge that Lula has will be to pacify the country," he said. "People are not only polarized on political matters, but also have different values, identity and opinions. What's more, they don't care what the other side's values, identities and opinions are."
Among world leaders offering congratulations on Sunday night was U.S. President Joe Biden, who in a statement highlighted the country's "free, fair, and credible elections." The European Union also commended the electoral authority for its effectiveness and transparency throughout the campaign.
Bolsonaro had been leading throughout the first half of the count and, as soon as da Silva overtook him, cars in the streets of downtown Sao Paulo began honking their horns. People in the streets of Rio de Janeiro's Ipanema neighborhood could be heard shouting, "It turned!"
Da Silva's headquarters in downtown Sao Paulo hotel only erupted once the final result was announced, underscoring the tension that was a hallmark of this race.
"Four years waiting for this," said Gabriela Souto, one of the few supporters allowed in due to heavy security.
Outside Bolsonaro's home in Rio, ground-zero for his support base, a woman atop a truck delivered a prayer over a speaker, then sang excitedly, trying to generate some energy as the tally grew for da Silva. But supporters decked out in the green and yellow of the flag barely responded. Many perked up when the national anthem played, singing along loudly with hands over their hearts.
For months, it appeared that da Silva was headed for easy victory as he kindled nostalgia for his presidency, when Brazil's economy was booming.
Bolsonaro's administration has been widely criticized for its handling of the COVID-19 pandemic and the worst deforestation in the Amazon rainforest in 15 years. But he has built a devoted base by presenting himself as protection from leftist policies that he says infringe on personal liberties while producing economic turmoil and moral rot. He sought to shore up support in an election year with vast government spending.
"We did not face an opponent, a candidate. We faced the machine of the Brazilian state put at his service so we could not win the election," da Silva told the crowd in Sao Paulo.
Da Silva built an extensive social welfare program during his tenure at president that helped lift tens of millions into the middle class. The man universally known as Lula left office with an approval rating above 80%, prompting then U.S. President Barack Obama to call him "the most popular politician on Earth."
But he is also remembered for his administration's involvement in vast corruption revealed by sprawling investigations.
Da Silva was jailed for 580 days for corruption and money laundering. His convictions were later annulled by Brazil's top court, which ruled the presiding judge had been biased and colluded with prosecutors. That enabled da Silva to run for president for the sixth time.
Da Silva has pledged to boost spending on the poor, reestablish relationships with foreign governments and take bold action to eliminate illegal clear-cutting in the Amazon rainforest.
"We will once again monitor and do surveillance in the Amazon. We will fight every illegal activity," da Silva said in his speech. "At the same time, we will promote sustainable development of communities in the Amazon."
The president-elect has pledged to install a ministry for Brazil's original peoples, which will be run by an Indigenous person.
But as da Silva tries to achieve these and other goals, he will be confronted by strong opposition from conservative lawmakers.
Unemployment this year has fallen to its lowest level since 2015 and, although overall inflation slowed during the campaign, food prices are increasing at a double-digit rate. Bolsonaro's welfare payments helped many Brazilians get by, but da Silva has been presenting himself as the candidate more willing to sustain aid going forward and raise the minimum wage.
In April, he tapped center-right Geraldo Alckmin, a former rival, to be his running mate. It was another key part of an effort to create a broad, pro-democracy front to not just unseat Bolsonaro, but to make it easier to govern.
Building bridges among a diverse -- and divided -- country will be key to his success, said Carlos Melo, a political science professor at Insper University in Sao Paulo.
"If Lula manages to talk to voters who didn't vote for him, which Bolsonaro never tried, and seeks negotiated solutions to the economic, social and political crisis we have," Melo said, "then he could reconnect Brazil to a time in which people could disagree and still get some things done."