Venezuela faces uncertainty after a narrow election win of a former bus driver annointed by the late leader Hugo Chavez.
Vice President Nicolas Maduro won by 235,000 ballots.
The Opposition has demanded a recount, claiming there were thousands of irregularities.
The National Electoral Council said Mr Maduro won 50.7% of the votes compared to 49.1% for Miranda state governor Henrique Capriles.
The council said more than 99% of the votes had been counted and that the result was "irreversible".
Following the announcement, clashes broke out between protesters and police in the capital Caracas.
Police fired tear gas at hundreds of students demonstrating in one part of the city, while elsewhere opposition supporters took to their balconies and the streets to bang pots and pans in protest.
Mr Capriles had earlier urged national protests and a march on the electoral offices in the capital in the event that Mr Maduro was declared victor.
He called on the National Electoral Council not to confirm the election result, citing voting irregularities, and demanded a recount.
Mr Chavez, who ruled for 14 years, chose Mr Maduro as his political heir in his last speech to the country before dying on 5 March.
The ABC reports that gave his former vice president a huge advantage, but Mr Capriles narrowed the gap in the final days of the campaign and the result was much closer than many had expected.
"I'm here to assume my responsibility with courage. The fight continues," Mr Maduro, 50, told a victory rally.
"This victory is another tribute to our comandante Hugo Chavez. Today we can say that we had a fair electoral triumph."
But Mr Capriles claimed his opponent had lost the poll and demanded an audit of the result.
"Today's loser is you," he told a news conference, referring to Mr Maduro.
"We won't recognise a result until every vote has been counted."