Brazil's unpredictable election took another twist Sunday, with leftist President Dilma Rousseff being forced into a runoff race as expected, but against a center-right challenger who only surged in the final week of the campaign.

Rousseff will face Aecio Neves in the Oct. 26 runoff vote, required as no single candidate won an outright majority. With 96 percent of the vote counted, the president had won 41 percent against Neves' 34 percent.

As surprising as Neves' rise was the fall from grace of another candidate, former environment minister Marina Silva, who took just 21 percent of the vote. In late August, she held a double-digit lead over Rousseff in polls after being thrust into the race when her Socialist Party's first candidate, Eduardo Campos, died in a plane crash. Late on Sunday, Silva said her coalition would be meeting soon to discuss endorsements for the second round of voting.

But over the past three weeks the powerful political machine of Rousseff's Workers' Party eviscerated Silva with what some analysts called the most negative and aggressive campaigning Brazil has seen since returning to democracy nearly 30 years ago. Silva fell hard in polls and could never regain her footing or get her message out.

Neves, however, had the backing of the well-organized Social Democracy Party, which held the presidency from 1994 until 2002, a period when Brazil tamed its hyperinflation and turned its economy around.

"Aecio's performance has been extraordinary and one of the reasons for this is the very strong party structure behind him — a party with a strong nationwide presence and which has been in the presidency," said Carlos Pereira, a political analyst with the Gertulio Vargas Foundation, Brazil's leading think tank. "It is now a new election where everything is wide open. Aecio, who until recently no one believed had a chance, has emerged as a very strong candidate."

Neves is an economist and former two-term governor of Minas Gerais, Brazil's second-most populous state, where he left office in 2010 with an approval rating above 90 percent.

He has strong name recognition in Brazil. Neves began his political career at age 23 as the personal secretary to his grandfather, Tancredo Neves, a widely beloved figure who was chosen to become Brazil's first post-dictatorship president but fell ill and died before taking office.

One year after his grandfather's death, Neves was elected to the first of four terms as congressman. The 54-year-old father of three also served one term as senator.

Neves' reputation took a hit in July, when respected daily Folha de S.Paulo alleged Neves' government spent around $5.5 million to build an airport on land belonging to an uncle of the then-governor. Neves later contested the accusations in an editorial in the same newspaper.

As for the fall of Silva, it was Rousseff's aggressive campaigning that eviscerated her support.

It was thought Silva could tap into the widespread disdain Brazilians hold for the political class — anger that boiled over into roiling, nationwide anti-government protests last year.

But she couldn't withstand a barrage of attacks labeling her as indecisive and without the mettle needed to lead the globe's fifth-largest nation — a message Rousseff repeated and repeated.

"Marina Silva tried but was not able to convey her message of change. She's only responding to attacks," said Paulo Sotero, director of the Brazil Institute at the Woodrow Wilson International Center for Scholars in Washington. "We've seen negative campaigning before, but never at this level of ferocity."

During nearly 12 years in power, the Workers' Party has ushered in strong social programs that have helped lift millions out of poverty and into the middle class. Rousseff's strongest support comes from the poorest, those who are precariously hanging onto gains amid an economy that has sputtered the past four years.

Rousseff promised to expand social programs and continue strong state involvement in the economy, even though critics complain it creates a poor business environment and the main stock market tumbled every time a new poll showed her on the rise.

Neves offered more centrist economic approaches, such as central bank independence, more privatizations and the pursuit of trade deals with Europe and the United States.

The Associated Press