In a development that has surprised absolutely no one who has been paying attention to Brazilian politics for the last four decades, Luiz Inácio Lula da Silva has done it again. The 80-year-old leftist staged a dramatic election fightback and defeated his far-right opponent, Flávio Bolsonaro, to claim a historic fourth term in power. With nearly 99% of votes counted, Lula received 51.75% of the vote to his 45-year-old rival's 48.25%, according to Tom Phillips and Tiago Rogero.

Lula narrowly lost the first round of the election to Bolsonaro in early October, casting his political future into doubt and plunging progressive Brazilians into three weeks of despair. Never, since the return of democracy in the 1980s, has the first round runner-up won the second vote. But Lula did precisely that on Sunday, prompting joyous scenes on the streets of São Paulo, where he had been following the count, and at the hotel where he was watching the count. For Lula, who turns 81 on Tuesday, the victory represents a sensational final chapter in a storied political career that began when he emerged as a union leader in São Paulo's industrial suburbs in the late 1970s.

Flávio Bolsonaro, for his part, is reportedly calling for Brazil's election results to be "annulled" after his loss to Lula and says he will not concede defeat to the incumbent president. He also described the extension of voting hours in the election runoff as unacceptable. The defeated senator's comments come after Brazil's supreme court extended voting time by two hours on Monday at the request of both candidates. Lula's request came after issues in nine states with buses that provide transportation to polls, while Bolsonaro's was due to heavy rains in the nation's south.

In his victory speech, Lula said his campaign defeated foreign intervention through digital platforms and that the platforms need to be regulated. He also said his campaign managed to convince people that voting was extremely important to safeguard democracy in Brazil. His party would change the way it ran the country and would make people participate more in the decision-making process, he said, quoted by Reuters. Lula delivered the speech to a São Paulo hall packed with supporters after being re-elected Brazilian president.

Reactions from political leaders in the region and beyond poured in, care of Reuters. "Long live democracy, the people of Brazil won. Congratulations, President Lula!" said one. Another added: "Congratulations Lula on your election as president of Brazil. I salute the Brazilian people for this great democratic journey. Paraguay and Brazil share a common agenda of integration and development. We will continue working together for the well-being of our people." Yet another: "I just spoke with the president-elect of Brazil, Luiz Inácio Lula da Silva, a friend. I congratulated him on the victory and on the democratic celebration that an electoral process represents." And: "I congratulate President Lula on his victory. Bolivia and Brazil are neighbouring and brother countries, united by a shared history and common challenges. We will continue working together to strengthen our relationship and generate more opportunities for our nations." Also: "Dear brother Lula, on behalf of the Cuban government and people, I congratulate you for this historic victory that ensures the continuity of the path of peace, sovereignty, and social justice embarked upon by the Brazilian people under your leadership." And finally: "I congratulate the Brazilian people for this democratic day and especially President Lula for the victory! We will continue working together for our countries."

Lula is about to come on stage at a conference hall in São Paulo and it is absolutely packed with ecstatic supporters and allies. They are standing in front of a giant Brazil flag and look over the moon. "This means that our democracy and our sovereignty are still alive," congresswoman Tabata Amaral told me as she arrived. Hundreds of supporters have packed the hall chanting: "Lula! The warrior! Of the Brazilian people!"

More than half an hour has passed since the result was announced and there is still no sign of far-right senator Flávio Bolsonaro in the area where dozens of journalists are waiting at the Brasília mansion where he followed the count. During the evening, smoke could be seen and the smell of a lively barbecue filled the air, but it ended with guests leaving looking dejected. One of them approached the press to shout that "it was the fucking north-east's fault", insulting the region where Lula has historically won most of his votes. Four years ago, when Jair Bolsonaro lost to Lula, supporters of the former president also directed prejudice at people from the region. Bolsonaro's press officer had said earlier that he would address the nation after the count, but since Lula's victory was announced his team has gone silent and journalists do not know when, or whether, it will happen.

The incumbent, who had lost by 2.2 million votes three weeks ago, has now won by 4.3 million. The 80-year-old leftist appears to have made up much of the difference through what his allies had identified as his main opportunity: persuading his voters to turn out. After a record abstention rate of 21.08% in the first round, which disproportionately affected Lula voters because they tend to live farther from polling stations, the rate fell to 19.21%. Lula is the first candidate in Brazil's democratic history to overturn a first-round defeat in a runoff.

Brazil's electoral court announced a short while ago that the leftist president has won against the far-right Bolsonaro and been elected for a fourth non-consecutive term. Images coming in from Brazil show Lula staging a stunning comeback against Bolsonaro to secure another term as president.

Reginaldo Lopes, a key Lula ally and congressman, marched into the hall where Lula is about to speak, and he is in very high spirits believing Lula has won. "I feel incredible. We are going to win these elections... because the people know that the Bolsonaro family will never deserve to occupy the presidential palace. The presidential palace is a place for people who are sensitive ... and in our next term we are going to see a revolution," he told me. Asked what a Lula victory would mean for Brazil, he replied: "This is Brazil telling the world that the extreme right is fascist, that the extreme right is against black people, is against the poor, against the state, against gay people ... We are going to reorganize the democratic forces [in this country]."

Lula is expected to arrive shortly and there are tears of joy as he closes in on a historic victory. Datafolha, one of Brazil's most established polling institutes and owned by the Folha de S Paulo newspaper, has projected that President Luiz Inácio Lula da Silva has completed his comeback against far-right senator Flávio Bolsonaro and will be the president of Brazil for a fourth time. The institute uses data from the official count and, "through its own system", makes a projection, which is already the headline in Folha and other Brazilian media outlets.

At Bolsonaro's headquarters in Brasília, the silence has been deafening since Lula retook the lead over the senator. Many of his guests, who arrived celebrating, wearing Brazil shirts and cheering like after goals every time an update showed him ahead, have already started leaving with dejected expressions and without speaking to the press. Bolsonaro is expected to make a statement shortly after the count is completed.

Earlier, Lula was reportedly holding a narrow lead over Flávio Bolsonaro with 75% of Brazil's votes counted. It was 51% Lula and 48.9% Bolsonaro with nearly 75% of votes counted. Lula seemed to be closing in on victory and the mood in his camp was increasingly excited. This would be an absolutely sensational comeback from one of the biggest figures in the modern history of Latin American politics. Lula had edged further ahead in the latest figures, reportedly taking 50.92% to Bolsonaro's 49.08% with 69.92% of ballots counted.

The celebratory mood that swept Flávio Bolsonaro's headquarters moments ago when he overtook Lula in the vote count disappeared since the president began closing the gap and moved back into the lead. Despite the earlier celebrations, the atmosphere has in some ways been tense since the start of the evening. Bolsonaro's campaign is showing signs that it may be preparing the ground not to concede if he is defeated. One of the most popular figures in Bolsonaro's party, congressman Nikolas Ferreira, appeared unusually tense while speaking to journalists - unlike the jokey demeanour he usually has in front of the cameras. "Either we win. Or we win. You've been warned."

There were screams of joy in Lula's hotel as he took the lead a few minutes ago. With nearly half of votes counted he then had 50.15% to Bolsonaro's 49.85%. "It's going to work out! It's going to work out! It has to!" one official told me. The mood here is increasingly upbeat with Bolsonaro's path to victory looking increasingly tricky.