Partial results and quick counts of votes showed Ollanta Humala, a leftist former military commander, on his way to defeating Keiko Fujimori, the conservative daughter of an imprisoned ex-president. A victory by Mr. Humala would raise big questions about the course of policy in one of Latin America's star economies, which has enjoyed 12 consecutive years of growth.
Incomplete results, tallying about 75% of ballots, showed Mr. Humala beating Ms. Fujimori by 50.087% to 49.913%. Electoral officials said the early results were weighted toward Lima and other urban areas—zones where Ms. Fujimori is strong, as opposed to the rural zones where Mr. Humala has more support.
Thus, analysts expect Mr. Humala's lead to widen as the rural votes are counted. Mr. Humala had a 3 percentage point margin of victory in a quick count of the vote at polling places conducted by the non-government group Transparencia, Two other quick counts by private polling agencies also showed Mr. Humala coming out on top, as did several exit polls. Additional official results were due to come in Monday.
Financial markets, which have been riding a roller coaster during the long campaign, would be almost certain to take a win by Mr. Humala badly, analysts say. Investors viewed Ms. Fujimori as the candidate who would maintain the policies of openness toward foreign investment and trade, which helped Peru grow by 9% last year. Mr. Humala, who has made sharply contradictory statements on economic policy, would face pressure to immediately send signals to the market by revealing who would serve in key positions, such as Prime Minister and Economy Minister.
Before the election, investors and analysts weren't sanguine about how a Humala administration would manage the economy, which depends heavily on mining and other natural resources. "I would say it is naïve to think that the economy under Humala would be operated without major modifications in the rules of the game," says Eduardo Moron, an economist at the Universidad del Pacifico in Lima. Mr. Moron says the mere fact that Mr. Humala has discussed changing established rules to financial and tax systems is having a chilling effect on investment, as business fears Mr. Humala will open up a Pandora's box. "There's a paralysis in various investment projects," Mr. Moron said.
A win would mark a great comeback for Mr. Humala, who narrowly lost the presidential election in 2006. Indeed, a poll in January by Ipsos-Apoyo showed that Ms. Fujimori would beat Mr. Humala 49% to 23% in a one-on-one race.
Mr. Humala showed himself to be ideologically flexible—chameleon-like, his enemies said. And, perhaps more importantly, he was relentless in hammering away at the legacy of corruption and oppression left by Ms. Fujimori father, Alberto Fujmori, who is serving a 25-year prison sentence for a civilian massacre committed during a war with guerrillas during his presidency in the 1990s.
With the help of Brazilian advisers, Mr. Humala reinvented his radical image, ditching the red T-shirt he wore in 2006 in favor of a business suit. He also adopted the moderate Brazilian president Luiz Inacio Lula da Silva as his mentor instead of the Venezuelan leftist Hugo Chávez, whose support had a boomerang effect, harming Mr. Humala with Peruvian voters in 2006.
After he and Ms. Fujimori emerged as top vote-getters in the first round of voting in April, Mr. Humala was deft in bringing together a coalition of strange bedfellows, united only by their antipathy for the Fujimoris. Nobel Prize winning novelist Mario Vargas Llosa, a die-hard conservative, shocked many of his old friends when he came out strongly for Mr. Humala, as "the lesser evil."
"Under any normal circumstances, we would never support anyone like that," Alvaro Vargas Llosa, a writer who is Mario's son said in a recent interview. "But against Fujimori, it's what we have, so let's make the best of it."
Mr. Humala scored points by asserting that Keiko Fujimori was simply the front person for a "mafia" headed by her father. "We all know that the true candidate of Fujimorism is Alberto Fujimori," Mr. Humala argued, saying Mr. Fujimori would pull the strings in her daughter's government from a jail cell.
Mr. Humala's policy adviser Kurt Burneo joked that Ms. Fujimori might need to negotiate "a strategic alliance with Interpol" to bring back into public sector some of her father's cronies who are still fugitives or in jail.
After running far to the left in the first round of voting, Mr. Humala tried shifting to the center during the runoff campaign. He replaced the highly interventionist 197-page governing proposal he touted in the first round of voting with a more moderate five-page plan in the runoff.
But after having gained support by incorporating outsiders onto his team, there are real questions of how Mr. Humala would govern. Even while campaigning as a moderate, Mr. Humala has continually veered off message and scared business with talk about possibly rewriting the constitution, renegotiating foreign trade deals, raising taxes and revamping private pensions. Ms. Fujimori complained that Mr. Humala "changes (economic) plans like he changes his shirt."
Even some of those who supported Mr. Humala seemed to do so with misgivings. "Peru doesn't deserve this scenario," said former president Alejandro Toledo, a centrist who came in fourth place in the first round of voting. "Ten years of growth could be thrown down the drain," he added. But not long after making those statements, Mr. Toledo, who was persecuted when Mr. Fujimori was in office, finally came out supporting Mr. Humala in the runoff.
A diplomatic cable from the U.S. Embassy in Lima in 2007 released by WikiLeaks, offered an evaluation of Mr. Humala after a lengthy meeting with then ambassador J. Curtis Struble. Mr. Humala's strengths included "charm, credibility with the poor and a handsome dark face in a country where most national leaders look unmistakably European," the cable said. But Mr. Humala also ha disadvantages, which include, "a military-molded personality that demands complete obedience and eschews compromise."
Analysts pointed out that Mr. Humala's military background couldn't be more unlike that of Mr. da Silva, who was a union leader accustomed to the give and take of negotiations. How Mr. Humala would balance the demands of his long-time leftist supporters and his more recent moderate ones is anyone's guess, analysts say.
—Robert Kozak contributed to this article