Hugo Chavez celebrates re-election in Venezuela
Venezuelan President Hugo Chavez has hailed a "perfect victory", after defeating Henrique Capriles to secure a fourth term in office.
Mr Chavez won 54% of the vote, the electoral council announced, with turnout at about 81%.
Brandishing a replica of the sword of independence hero Simon Bolivar, he pledged Venezuela would continue its "march towards democratic socialism".
But he also vowed to engage opponents and to be a "better president".
Noisy celebrations among Chavez supporters erupted across the capital, Caracas, following the announcement of the result.
Mr Chavez addressed them from the balcony of the presidential palace.
"Truthfully, this has been the perfect battle, a democratic battle. Venezuela will continue its march toward the democratic socialism of the 21st Century."
But Mr Chavez also accepted that there had been a significant opposition vote, reducing his victory margin from 27 points in 2006 to just 10 points over Mr Capriles.
Almost all of the votes have now been counted, with Mr Chavez securing 54.66% to Mr Capriles' 44.73%.
The US, which has had strained relations with Mr Chavez, congratulated Venezuela for a high turnout and generally peaceful voting, but said the opposition should also be heard.
"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 state department spokesman William Ostick.
Mr Chavez praised the opposition for recognising the election result, and said he was "stretching out my hands and heart on our behalf because we are brothers in Bolivar's homeland".
He also invited to dialogue all those he said were "sowing hatred and social venom".
Mr Chavez recognised his new government would need "to respond with greater efficacy and efficiency to the needs of our people", adding: "I promise you I'll be a better president."
Jubilant Chavez supporters held impromptu street parties in central Caracas, blaring horns and waving flags.
"I'm celebrating with a big heart - Chavez is the hope of the people and of Latin America," said Chavez supporter Mary Reina.
Construction worker Edgar Gonzalez said: "I can't describe the relief and happiness I feel right now.
"The revolution will continue, thanks to God and the people of this great country."
At the Capriles' campaign headquarters, some opposition supporters were in tears at the news.
Mr Capriles congratulated Mr Chavez but told opposition supporters not to feel defeated.
"I want to congratulate the candidate, the president of the republic," he said at his campaign headquarters.
He added: "We have planted many seeds across Venezuela and I know that these seeds are going to produce many trees. I will continue working to build one country."
Mr Capriles said he hoped Mr Chavez would recognise that almost half the country disagreed with his policies.
Mr Capriles said: "There's a country that is divided and to be a good president means to work for all Venezuelans, to work for the solution of all Venezuelans' problems."
Mr Chavez, 58, was diagnosed with cancer last year but says he is now fully recovered.
He has been in power since 1999 and has nationalised key sectors of the economy.
Venezuela is a major oil producer and high oil prices have allowed his government to fund healthcare, education programmes and social housing.
In his campaign, Mr Capriles, who headed a coalition of 30 opposition parties, said the president's policies had led to bureaucracy, inefficiency and shortages.
Analysts say Mr Chavez's victory will be welcomed by several countries in the region - including Cuba and Nicaragua - that benefit from his Petrocaribe scheme which provides Venezuelan oil at preferential rates.
He also has strong ties to Argentine President Cristina Fernandez de Kirchner, backing Argentina's sovereignty dispute with Britain over the Falkland Islands.
After the election result was announced, President Fernandez tweeted: "Your victory is our victory! And the victory of South America and the Caribbean!"
President Chavez's new six-year term will begin on 10 January.