President Dilma Rousseff vowed to bring change to Brazil after narrowly being re-elected in Sunday's runoff election against Aécio Neves.

Speaking to crowds in the capital of Brasília, Rousseff thanked those who supported her and paid homage to her political mentor and popular presidential predecessor, Luiz Inácio Lula da Silva, who stood beside her.

With nearly 100 percent of votes counted, the Workers' Party (PT) candidate took 51.6 percent of the vote, while Neves, of the Brazilian Social Democracy Party (PSDB) received 48.4 percent.

Acutely aware of her narrow victory, the president emphasized that she was open for dialogue with other parties, and thanked running mate Michel Temer of the PMDB -- a huge kingmaker party that must be won over to have any chance of governing Brazil's complex multi-party system effectively -- for his support.

Also conscious of how divided the country has become, Rousseff asked Brazilians to unite "for the good of the country" after the most bitterly-contested campaign in recent history.

"A number of words and themes dominated this campaign, but the most repeated ... was 'change,’" she told party activists. With a hoarse voice she added that she had been given a second term to "make the great changes that Brazilian society is demanding" which should be carried out in a "peaceful, democratic way ... at this moment of transformation."

The president also recognized the controversies surrounding corruption allegations and a barrage of personal attacks that marred the campaign, vowing to tackle the "impunity" that society fears protects corrupt politicians.

A historic, fourth-consecutive victory for the governing Workers' Party means the leftist party is set to remain in power until 2018, after coming to power 12 years ago under Lula. 

Rousseff's second term is the maximum permissible under Brazilian law, and speculation has already begun as to whether the former president will return in four years' time. Sunday's win however, was secured in the tightest and most bitterly-fought Brazilian presidential elections since the country's return to democracy in the late 1980s.

Many Brazilians said they were concerned by the lackluster performance of the economy under PT, particularly in São Paulo state -- the country's economic heartland -- where Neves, the market favorite, won a resounding victory.

Admitting defeat, Neves -- who lost in his native Minas Gerais, reinforcing its reputation as Brazil's bellwether state -- said he called the president to congratulate her on her re-election. He said that he had led a "good fight in good faith," and thanked Brazilians who took part in the country's "festival of democracy."

Fourteen governors were also elected in Sunday's runoff, including in Rio de Janeiro, where the PMDB's Luiz Fernando Pezão claimed victory.

Some 142.8 million people were eligible to vote although about 21 percent abstained, and more than 6 percent of voters decided to cast a blank or void ballot.

Anadolu Agency