Dilma Rousseff, the leading candidate to succeed Luiz Inacio Lula as Brazil's leader, will head to a runoff later this month, having won Sunday's presidential election but failed to secure an absolute majority.

The country's supreme electoral court said Rousseff captured 46.6 per cent of the vote, Jose Serra, a former governor of Sao Paulo state, got 32.8 per cent support, and Marina Silva, the Green Party candidate, got a surprising 19.5 per cent with 98 per cent of the votes counted.

Rousseff needed 50 per cent-plus-one to avoid a knockout round against Serra. She has to face Serra in the runoff on October 31.

"We can confirm there will be a second round in the presidential elections," Ricardo Lewandowski, the president of the High Electoral Tribunal, said in the capital, Brasilia.

Rousseff, the endorsed candidate of Lula's Workers' Party, is favoured to beat her challenger in the next round and become the first woman to lead Brazil.

Serra, one of Brazil's most experienced politicians, should now have an additional four weeks to chip away at Rousseff's lead.

Election spoiler

The election resulting in the second ballot is due to Silva, 52, a former environment minister who is not related to the president. Silva had about 20 per cent of valid votes.

Runoffs are common in Brazil - Lula faced them in 2002 and 2006, and emerged with a strong mandate in both cases - and Rousseff is expected to take victory.

Lula has dominated the campaign despite being barred by the constitution from running for a third consecutive term.

Serra, right, has won 32.8 per cent of valid votes [Reuters]

Rousseff joined the outgoing president in his hometown of Sao Bernardo do Campo on Sao Paulo's southern outskirts for a large rally on Saturday ahead of the election.

Lula enjoys an 80 per cent popularity rating - unprecedented in Brazilian politics - and many voters are prepared to support Rousseff due to his endorsement. For her part, Rousseff has pledged to continue many of her mentor's investor-friendly policies.

Lucia Newman, Al Jazeera's Latin America editor, reporting from Sao Paulo, said that the main change in Brazil after the election was likely to be the gender of the president.

"[Rousseff] is very much the candidate of continuity. She is promising no more, no less, than President Lula's economic, social and foreign policies," she said.

While none of the three leading candidates come close to mustering the magnetic charisma Lula has, they all have histories just as fascinating as his.

Rousseff was a crucial player in an armed militant group that resisted Brazil's 1964-85 military dictatorship.

She was imprisoned for nearly three years beginning in 1970 and tortured. She is a cancer survivor, a former minister of energy and chief of staff to Silva.

Key contenders

Rousseff is more moderate than in her youth and has promised a government of pragmatic capitalism.

Serra, in addition to being a former mayor and senator, served as health minister under president Fernando Henrique Cardoso and won praise for defying the pharmaceutical lobby to market inexpensive generic drugs and free anti-Aids medicine.

Silva is a renowned environmentalist who was born in the Amazon, the daughter of a poor rubber tapper.

Despite being illiterate into her teens, she went on to earn a university degree and has since worked tirelessly to defend Brazil's rainforest.

About 135 million voters also cast ballots for governors, mayors and state and federal houses of congress.

Under Brazilian law, voting is mandatory for citizens between the ages of 18 and 70. Not voting could result in a small fine and make it impossible to obtain a passport or a government job, among other penalties.

Electoral authorities in Brasilia said 368 people were arrested across Brazil on Sunday for election violations, such as trying to buy votes, illegally transporting people to polls and distributing campaign materials past deadline.