Updated

Former President Alan Garcia defeated an ex-army nationalist in Peru's runoff election on Sunday, a stunning comeback for a politician whose first term ended in economic ruin and rebel violence.

Garcia's victory was a blow to Venezuelan President Hugo Chavez, who had endorsed his rival Ollanta Humala, a political upstart deemed dangerous to democracy by many Peruvians.

"We've rescued independence," Garcia, Peru's president from 1985-90, told thousands of ebullient supporters even before the official results were announced.

He said voters had sent an overwhelming message to Chavez that they rejected the "strategy of expansion of a militaristic, retrograde model that he has tried to impose in South America."

CountryWatch: Peru

Chavez has already extended his regional influence in gaining a loyal ally with the December election of Evo Morales as Bolivia's president. Like Morales, Humala had pledged to punish a corrupt political establishment and redistribute wealth to his country's poor Indian and mestizo majority.

Garcia held an insurmountable lead of 55.5 percent against 44.5 percent for Humala with 77.3 percent of the vote counted, said the head of the electoral agency, Magdalena Chu.

The margin was expected to shrink, however, as Humala's support is strongest in rural areas where vote reporting is slower. Unofficial partial ballot counts by two respected polling companies and a citizen's watchdog group all gave Garcia more than 52 percent of the vote.

There were no signs that Humala's followers might take to the streets to protest, as some had feared if he lost, and his spokeswoman said he had not conceded and would await final results.

Humala won big in the heavily Indian southern Andes but his radical rhetoric frightened many in the more industrialized northern coast and in Lima, the capital, where Garcia said he had won 65 percent of the vote.

The bitterly fought election included street clashes and virulent exchanges of slurs, including from Chavez, who exacerbated the ill will by vigorously endorsing Humala and calling Garcia a crook.

At one point, Garcia was hit in the face by an egg, leaving a nasty bruise. The attack, in the highland city of Cuzco, a stronghold for Humala, was followed hours later by a shootout involving supporters of the two rivals.

In the final days of campaigning, election observers from the Organization of American States urged the two campaigns to tone down the rhetoric and avoid violence.

Humala, a 43-year-old retired military man, spooked upper- and middle-class Peruvians by attacking the established parties as corrupt and unresponsive to the needs of the poor. He vowed to write a new constitution stripping them of power.

Garcia, 57, adroitly turned the race into a referendum on the Chavez factor, depicting Humala as an aspiring despot who would fall into lockstep with the Venezuelan's populist economics and Cuba-friendly anti-Americanism.

He labeled Chavez, who is rolling in petrodollars from record-high oil prices, as "a midget dictator with a big wallet." Chavez in turn called Garcia "a genuine thief, a demagogue, a liar."

Humala found favor among Peru's poor with his vows to follow the lead of Chavez and Morales by imposing higher taxes on foreign companies that exploit the nation's natural resources.

Many Peruvians feel they have not benefited from economic growth that averaged 5.5 percent over the past 4 years, when the poverty rate dropped just two percentage points to 52 percent.

That helped propel Humala to victory in a first round of voting on April 9 among 20 candidates. Garcia qualified with a razor-thin victory over the third-place candidate.

Humala is a mestizo with a middle-class upbringing whose fiercely nationalist father believes Peru's "copper-skinned" majority should rule over its European-descended elite. Humala says he doesn't share his father's racist views.

Garcia knew that the raging inflation, widespread corruption and rebel violence that marked his first term would give many Peruvians pause. But he said he was determined not to repeat his mistakes.

"I want our party this time to demonstrate to the Peruvian people, who have called it to the highest responsibilities, that it will not convert the state into booty," he said in his speech Sunday night at the headquarters of his Aprista party.

Tens of thousands of party members landed state jobs while Garcia was president. He left office in disgrace in 1990 and two years later fled into exile after his successor Alberto Fujimori shut down Congress and tried to arrest him. He returned to Peru in early 2001 after the Supreme Court ruled that the statute of limitations on corruption charges against him had expired.

Garcia made a spectacular run for the presidency in Peru's previous election, winning a spot in the runoff and narrowly losing to current President Alejandro Toledo.