President Hugo Chavez said on Sunday that truth and dignity had triumphed in Venezuela, after winning a referendum allowing him unlimited reelection to remain in office.
"Truth against lies (and) the dignity of the homeland have triumphed," Chavez shouted from the balcony of his Miraflores palace to cheering supporters.
"The doors of the future are wide open," Chavez told the crowd shouting "victory, victory, popular victory!"
Fireworks lit the Caracas sky immediately after the result was announced, and Chavez party members celebrated in the streets.
Chavez won 54.36 per cent of preliminary results, according to National Electoral Council President Tibisay Lucena.
The opposition won 45.63 per cent of the vote, in which more than 11 million of almost 17 million eligible voters took part, Lucena said.
"We'd like to congratulate all the people of Venezuela for the civic and democratic behavior they demonstrated today. It was an extraordinary day," Lucena added.
Venezuelans voted on an amendment to five articles of the constitution which would allow the president, mayors, local councilors, lawmakers and governors unlimited bids for re-election.
Currently the president is permitted two consecutive, six-year terms, which would have forced the leftist Chavez, elected in 1998 and again in 2006, to step down at the end of his second mandate in 2013.
Chavez is popular with the country's poor for oil-funded health care and education programs and blamed by a vocal opposition for rising crime, corruption and inflation.