Venezuela's Hugo Chavez has pledged to become a "better president" and work with the opposition after winning a tough re-election battle that betrayed simmering discontent at his socialist revolution.
The leftist president's victory on Sunday was a relief to like-minded allies in the region, with Cuban leader Raul Castro hailing his friend's "historic triumph", while the US urged him to listen to the opposition.
After almost 14 years in power, Chavez survived cancer and the most formidable opponent of his presidency, youthful former state governor Henrique Capriles, to win the election and another six-year term.
The 58-year-old Chavez pledged to deepen his oil-funded socialist revolution after hailing his "perfect" victory.
But he also reached out to disenchanted voters by pledging to work with the opposition, a tacit acceptance that this was a narrower victory than in the past and that Venezuela is a country very much divided.
|Follow our in-depth coverage of the presidential poll
"I want to include everybody, including sectors of the opposition," Chavez, wearing his trademark red shirt, told thousands of cheering supporters from the balcony of his Miraflores presidential residence.
"I commit to being a better president than I've been these past few years."
Alluding to his cancer battle, he said: "I thank God and ask him life and health to keep serving the Venezuelan people."
Picked by the once divided opposition in an unprecedented primary, Capriles, 40, was able to woo voters from Chavez with promises to curb rising crime, reform the oil-dependent economy and unite the polarised nation.
After a massive 81 per cent turnout, Chavez won 55 per cent, or nearly eight million, of the votes, while Capriles gave the opposition its best score against the president, 44.39 per cent, or 6.4 million ballots.
In 2006, Chavez beat opposition candidate Manuel Rosales comprehensively, taking 62 per cent of the vote and winning by a massive 25-point margin.
Chavez can still count on a devout following among the country's long-neglected poor, who adore him for the social "missions" that give them free health care, subsidized food, and sometimes housing.
"Venezuela will continue its march toward the democratic socialism of the 21st century," Chavez said in his victory speech.
But Capriles attracted huge crowds at rallies and his picture could be seen on some homes in Chavez slum bastions after the sports-mad candidate visited 300 towns in a high-octane campaign across the nation.
While accepting defeat with grace, Capriles vowed to continue fighting for the 6.4 million people who voted for him.
"The people contributed to opening a new path and this path is here," Capriles, wearing a jacket in Venezuela's yellow, blue and red colours, told supporters late on Sunday.
"I am also on this path and I won't leave almost half the country alone," he said.
The United States and the European Union urged Chavez to extend a hand to the opposition.
"We believe that the views of the more than six million people who voted for the opposition should be taken into account going forward," said William Ostick, a US state department spokesman.
"We congratulate the Venezuelan people for the high turnout and generally peaceful manner in which this election was carried out," he added.
White House spokesman Jay Carney said: "We have our differences with President Chavez ... But we congratulate the Venezuelan people."
EU foreign policy chief Catherine Ashton congratulated Chavez while also urging him "to reach out to all segments" of society.
The opposition had accused Chavez of misusing public funds for his campaign and dominating the airwaves while forcing government workers to attend rallies through intimidation.
The fate of Chavez, a fierce US critic and the leading voice of Latin America's left, was closely watched by communist ally Cuba, which heavily depends on Venezuela's oil, and other regional partners.
Castro pledged Cuba's "solidarity and unbreakable support," while Evo Morales, the Bolivian president, called his fellow leftist's triumph "a victory for the Bolivarian alliance and all of Latin America".