RIO DE JANEIRO - Brazil's leftist President Dilma Rousseff narrowly won reelection to a second term Sunday, calling for unity after the most divisive race since the return to democracy in 1985.
Rousseff, the first woman president of the world's seventh-largest economy, took 51.64 per cent of the vote to 48.36 per cent for business favourite Aecio Neves, election officials said with more than 99 per cent of ballots counted.
After a vitriolic campaign that largely split the country between the poor north and wealthier south, Rousseff crucially picked up enough middle-class votes in the industrialized southeast to cement a fourth straight win for her Workers' Party (PT).
The 66-year-old, a former leftist guerrilla who was jailed and tortured for fighting the 1964-1985 dictatorship, called for unity. And she promised dialogue to give Brazil the changes she said that she knows voters want.
"This president is open to dialogue. This is the top priority of my second term," she told supporters in the capital Brasilia, clad in white beside two-term predecessor Luiz Inacio Lula da Silva.
After four years of sluggish economic growth culminating in recession this year, she admitted her own report card had to improve and vowed to combat corruption.
"I want to be a much better president than I have been to date," she said, issuing "a call for peace and unity" after a bitter campaign of low blows and mutual recriminations.
Major challenges to govern
Neves, a 54-year-old senator, said he had called Rousseff to congratulate her.
"I told her the priority should be to unite Brazil," he told disappointed supporters in Belo Horizonte, where he served two terms as governor of Minas Gerais state.
Rousseff and Neves both hail from the southeastern state, where the incumbent managed to win 52.4 per cent to 47.6 per cent.
A Brazilian political adage has it that whoever wins Minas wins Brazil.
The race was widely seen as a referendum on 12 years of PT government, with voters weighing the party's landmark social gains against Neves's promise of economic revival through market-friendly policy.
The PT endeared itself to the masses with landmark social programs that have lifted 40 million Brazilians from poverty, increased wages and brought unemployment to a record-low 4.9 per cent.
But the outlook has darkened since Rousseff won election in 2010, the year economic growth peaked at 7.5 per cent.
She has presided over rising inflation and a recession this year, amid protests against corruption, record spending on the World Cup and poor public services.
Analysts said she would face a number of steep challenges to govern for the next four years.
"Dilma's narrow victory sets up a major challenge: she has to unite a Brazil split in two by tremendous animosity," said political analyst Daniel Barcelos Vargas of the Getulio Vargas Foundation.
"Brazilians won't tolerate corruption any more and want more public services and economic growth. To provide that she will have to dialogue with a very fragmented Congress that is more conservative than before, and that will accentuate the divide between the executive and the legislature."
Sticky corruption problem
Rousseff has been hit by corruption scandals, especially a multi-billion-dollar embezzlement scheme implicating dozens of politicians - mainly her allies - at state-owned oil giant Petrobras.
As the fiery campaign ended, conservative news magazine Veja quoted a suspect in the case as saying Rousseff and Lula personally knew of the scam - a claim the president vehemently denied.
But the issue will dog her, said independent consultant Andre Cesar.
"If the allegations are confirmed that could spark a political crisis," he told AFP.
The campaign was a fierce battle for Rousseff, who has a reputation for toughness and an iron grasp of even the smallest policy details.
In the first round, she had to fend off a blistering challenge by popular environmentalist Marina Silva, who at one point looked poised to make good on her vow to become Brazil's first "poor, black" president.
Rousseff managed to win the first round on October 5, only to fall behind Neves in the opinion polls as Silva endorsed him.
A furious Rousseff went on the attack, accusing Neves of nepotism in Minas Gerais and playing up a report that he once hit his then-girlfriend in public.
Neves, the grandson of the man elected Brazil's first post-dictatorship president, responded by accusing Rousseff of lying and "collusion" in the Petrobras kickbacks.
As well as their president, voters also elected governors in runoffs in 14 states, with Luiz Fernando Pezao of the Brazilian Democratic Movement Party (PMDB) - a Rousseff coalition ally - winning in Rio de Janeiro.
Nationwide 451 people were arrested for election-related "irregularities" - one for taking a "selfie" in a poll booth in Sao Paulo state, while two buses were set on fire in the same state.