RIO DE JANEIRO - Leftist President Dilma Rousseff vowed to reconcile Brazil, reboot the economy and fight corruption after narrowly winning reelection Sunday in 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.6 percent of the vote to 48.4 percent for business favorite Aecio Neves in a run-off election.

After a vitriolic campaign that largely split the country between the poor north and the 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). She will start her second four-year term on January 1 facing a laundry list of challenges: governing a polarized country, winning back the confidence of markets and investors, rebooting the stagnant economy and tackling corruption.

The 66-year-old, a former leftist guerrilla who was jailed and tortured for fighting the 1964-1985 dictatorship, called for unity in her victory speech.

And she promised to listen to voters’ demands for change.

“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 alongside 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.

“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.

In Sao Paulo, capital of the country’s wealthiest state, Neves supporters watched the scene in disgust and chanted “Kick the PT out!”

Lula recognized the country’s heavy division Monday in remarks published in local newspapers.

“Coexisting will now be increasingly difficult... Rather than complain, we have to think about constructing a functioning government in the country,” he said.

Neves, a 54-year-old senator, called Rousseff to congratulate her.

“I told her the priority should be to unite Brazil,” he said to disappointed supporters in Belo Horizonte, where he served two terms as governor of Minas Gerais state.

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.

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 percent.

But the outlook has darkened since Rousseff won election in 2010, the year economic growth peaked at 7.5 percent. 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 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 in Sao Paulo.

“Brazilians won’t tolerate corruption anymore and want more public services and economic growth.”

Rousseff has been hit hard by corruption scandals, notably a multi-billion-dollar embezzlement scheme implicating dozens of politicians - mainly her allies - at state-owned oil giant Petrobras.

But “it was the older generation that decided the election, and they voted for continuity,” wrote columnist Jose Roberto de Toledo in O Estado de Sao Paulo newspaper Monday.

“They didn’t take a risk because, in spite of not being as well-educated as their children, they’re seeing an increase in income that not even their grandparents knew,” he said.

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.

Rousseff now has to try to win back the confidence of the business world after defeating its darling.

Markets have grown allergic to the president, with stocks and the real currency falling every time her poll numbers rose during the campaign.

“Rousseff’s first challenge is to reconcile with the market, to begin a good dialogue with the business sector, the financial sector, which were undoubtedly very unhappy with her,” said political analyst Marco Antonio Teixeira of the Getulio Vargas Foundation.

The president has already announced plans to replace Finance Minister Guido Mantega, and investors are watching closely to see who she names.