Brazil set for second round clash as Rousseff stumbles
In the end, President Luiz Inacio Lula da Silva's immense popularity was not enough to secure an outright first round win in Brazil's presidential election for his preferred successor, Dilma Rousseff.
Needing half of the valid votes for victory, Ms Rousseff of the Workers Party (PT) finished with 47%.
This sets up a 31 October second round clash with Jose Serra of the Brazilian Social Democratic Party (PSDB), who came second with 33%.
Ms Rousseff remains the clear favourite to win the election and become Brazil's first female president, but four more weeks of campaigning could be enough to turn the tide.
"I think it's going to be a political war now. Both the government and the opposition camps will play dirty to win the elections", said Roseli Coelho, a political scientist from Sao Paulo School of Sociology and Politics (Fesp).
Just over a week before the first round, Ms Rousseff appeared to be heading for a first round win, riding on President Lula's approval ratings of nearly 80%. But her lead stuttered, as corruption allegations involving a former aide surfaced.
"Of course we cannot limit the reasons for her losses to only one thing but this corruption scandal was certainly her most acute problem," said Claudio Couto, a political scientist at the Getulio Vargas Foundation (FGV).
It has also been suggested that Ms Rousseff's stance on the right to abortion may have cost her support from evangelical voters. There is no hard evidence to support this, but analysts believe that many of these voters turned to the Green Party's (PV) Marina Silva, an evangelical Christian herself and former environment minister in Lula's government.
Ms Silva was one of the big winners in this election, gathering some 19% of the vote, far more than the opinion polls had suggested.
"The sudden growth of Marina Silva was one of the big surprises of these elections. No one was really expecting this," said Professor Coelho.
Claudio Couto believes that the way Ms Silva's vote base swings could be key to the outcome of the second round, although he says it is unclear how much influence she has on her supporters' decisions.
"I think that the more likely scenario is to have these voters more or less evenly split between the two candidates. But even if Jose Serra gets 70% of Marina Silva's votes and Dilma Roussef the other 30%, it would still be enough for her to win," he said.
Aware of the importance of these votes, Jose Serra praised Marina Silva in a stump speech to his supporters, after results confirmed that he would he heading into the second round run-off.
"Marina Silva was essential for Brazilian democracy because she made the second round possible. It was also very important that she has managed to interest so many young people in politics", said Mr Serra, stopping short though of openly asking for support.
While there was euphoria in the Serra camp, fuelled by the surprise second round, in the Workers Party campaign headquarters there was bitter disappointment, with victory taken away at the last moment.
Ms Rousseff herself put a positive spin on the outcome, saying that the Workers Party traditionally did well in second rounds.
"I will face this second round with a lot of strength and energy. In this second round, I will have the opportunity to further detail my proposals, present my projects to eradicate poverty and develop the country," she said.
For the first round, Ms Rousseff staked her candidacy almost solely on President Lula's popularity and on the promise that she would follow closely on the path set by her mentor.
Stressing continuity was important because Ms Rousseff had practically no name recognition until earlier this year when campaigning began in earnest.
In great part, this strategy has worked but it also left the impression that she would be no more than Lula's shadow.
Roseli Coelho believes that Ms Rousseff will develop her leadership if and when she takes office.
"Political power is an amazing thing. Once she had it, she would discover a strong leader in herself," Prof Coelho said.
It is not clear what President Lula will do once he leaves office, and he does not make the guesswork any easier with his contradictory statements.
On a number of occasions Lula has said that all he is thinking about once he leaves the presidency is to have a good rest and dedicate his days to fishing.
But he has also suggested that he would keep a close eye on his chosen successor.
"I am going to travel around the country to see what's wrong and then I will call Dilma to say 'my child, there's something here you have to sort because I haven't managed to in my time'", the president said halfway through the campaign.
If Dilma Roussef does not win the second round, President Lula will not enjoy such a direct line to his old office but his legacy is unlikely to vanish.
Lula may not have been able to transfer to Ms. Rousseff as much of his popularity as the Workers Party had hoped, but the president's image was dominant during the first round of the and he is likely to remain a very influential figure no matter who gets elected.