However, left-leaning president-elect Luiz Inacio Lula da Silva is not without his own history, having previously served two terms as president of Brazil.
When Mr Lula, 77, co-founder of the Workers’ Party (PT), takes office in January after winning 50.6 per cent of the vote in the second round run-off against Mr Bolsonaro, he will be the oldest holder of the position in history.
Indeed, he is not a new face to Brazilian politics. His first two terms as president, which began in 2003, ended in 2010 when he passed on the candidature to his former chief of staff Dilma Vana Rousseff. Ms Rousseff was impeached five years later after being charged with criminal administrative misconduct and disregard for the federal budget. The decision to remove Ms Rousseff from office meant centre-right vice president Michael Temer succeeded her and served out the remainder of her second term.
However, in the last election, in 2018, when Mr Bolsonaro took power, Mr Lula was not able to stand against him – he was in prison. The former president served a 580-day prison term for a conviction of corruption relating to bribes he was accused of receiving from a building firm in return for contracts with Brazil's state oil company Petrobras. The first term of his presidency had already been plagued by other corruption scandals, including the Mensalão vote-buying scandal, which Mr Lula has always insisted he knew nothing about.
The criminal investigation into the Petrobas affair, known as "Operation Car Wash", saw numerous politicians jailed.
However, in 2021, a Supreme Court ruling annulled his conviction and ended his ten-year sentence after it ruled the judge, Sérgio Moro, who was later named justice minister by Mr Lula, may have been partial in his decisions, passing on “advice, investigative leads, and inside information to the prosecutors” to prevent Mr Lula's Workers' Party from winning the 2018 elections.
Released two years earlier due to a change in policy that meant prisoners could not serve time while their appeals were pending, Mr Lula referenced the conviction as he announced his win on Sunday night.
"They tried to bury me alive and here I am," he told supporters in his victory speech. He has previously drawn comparisons with his jail term to Nelson Mandela and Martin Luther King Jr.
His past success has been one of his main campaign pushes, selling the idea to jaded Brazilians of a return to the past, when the nation’s economy was thriving and his presidency was lauded for a raft of social policies that lifted millions out of poverty.
Mr Lula has also previously referenced his humble beginnings. He was one of eight children from a farming family and dropped out of school to become a shoe-shiner, later getting a job at a factory where he lost a finger in an accident. The incident saw him become involved in trade-union activism, which kickstarted his political career.
"If I failed, it would be the workers' class which would be failing,” he said in his farewell speech after his presidency ended in 2010. “It would be this country's poor who would be proving they did not have what it takes to rule.”
In this campaign, Mr Silva has pledged to crack down on corruption, saying if elected he would create new mechanisms to investigate anyone in his government accused of corruption and punish them if proven guilty.
"Whoever makes a mistake will pay, you can be sure of that," he said in a TV interview earlier this year.
World leaders have welcomed the result. Mr Bolsonaro’s far-right politics saw controversies over Covid vaccine scepticism, as well as a court case in 2015 that saw him convicted on counts of hedonic damages over comments made about a congresswoman, Maria do Rosario.
French president Emmanuel Macron said Mr Lula’s appointment would “renew the ties of friendship” between France and Brazil.
"Together, we will join forces to take up the many common challenges and renew the ties of friendship between our two countries,” he said.
UK Prime Minister Rishi Sunak said: “I look forward to working together on the issues that matter to the UK and Brazil, from growing the global economy to protecting the planet’s natural resources and promoting democratic values.”
The win is the latest in a line of victories for the left-wing in South America.
Argentina's president Alberto Fernandez said Mr Lula's win "opens a new era for the history of Latin America, a time of hope and future that begins today".
"After so many injustices you lived through, the people of Brazil have elected you and democracy has triumphed," he said.
Colombia’s first left-leaning president, who won the election this summer, tweeted "Long live Lula”, alongside a map showing left-wing governments in the region.
Russian president Vladimir Putin insisted this week he had “good relations” with both Mr Bolsonaro and Mr Lula. However, his relationship with Mr Bolsonaro was more favourable than the Kremlin leader has with most other countries.
Mr Bolsonaro personally refused to condemn Russia’s invasion of Ukraine – despite Brazil voting in favour of a draft United Nations Security Council resolution condemning Russia's invasion of Ukraine. He had said Brazil would not take sides. The two countries are allied through the BRICS grouping – an economic gathering of the emerging economies of Brazil, Russia, India, China and South Africa.
However, along with other world leaders, Mr Putin also offered his "sincere congratulations" to Mr Lula, saying the results had confirmed the new leader’s "impressive political authority".