(Election law forbids publication of polls in Venezuela for a week before voting)
By Daniel Wallis and Todd Benson
CARACAS (Reuters) - Venezuelans vote on Sunday with President Hugo Chavez facing the biggest electoral challenge yet to his socialist rule from a young rival tapping into discontent over crime and cronyism.
Henrique Capriles, a centrist state governor, edged toward the still popular Chavez in final polls thanks to a vigorous campaign that united the opposition and made him its best chance of ending Chavez's 14-year rule.
Chavez has used record oil revenue to support ideological allies around the world, while preaching a fiercely anti-U.S. line, so the election will be watched eagerly from the United States to Belarus and Iran.
Across the poor neighborhoods where the flamboyant former soldier draws his most fervent following, loyalists prepared to blow bugles and trumpets in a predawn wake-up call for voters.
Opposition sympathizers banged pots and pans in a protest against Chavez on Saturday night, creating a racket in the upscale neighborhoods of eastern Caracas. In the city center, which is more pro-government, the noise was drowned out by supporters playing his campaign music and shouting his name.
"I ask political actors from the left, right and center to prepare emotionally to accept tomorrow's results. It's not going to be the end of the world for anyone," Chavez said at a last- minute news conference at the presidential palace.
The 58-year-old president staged a remarkable comeback from cancer this year. But he could not match the energy of past campaigns - or the pace set by his 40-year-old basketball-loving opponent.
Most well-known pollsters put Chavez in front. But two have Capriles just ahead, and his numbers have crept up in others.
There is a risk of violence if the result is contested.
There will be no formal international observers, although Venezuela invited a delegation of the UNASUR group of South American nations to "accompany" the vote.
Local groups will be monitoring and both sides say they trust the electronic, fingerprint vote system. The opposition says it will have witnesses at all of the 13,810 polling centers from tiny Amazon villages to tough Caracas slums.
Capriles geared up on Saturday for the vote by hiking a mountain trail at the edge of Caracas that is popular with athletic Venezuelans. He donned running clothes and mirrored sunglasses, and posed for pictures with supporters.
Chavez spent about half an hour in the evening speaking to reporters alongside members of the UNASUR delegation, headed by an Argentine politician. Asked by one reporter if he wanted to stay in office beyond 2018, he glibly replied, "Twenty years is nothing," in reference to a popular Argentine tango song.
Capriles shot back via Twitter. "Right now some people continue with the same nonsense and the same stories as always, the difference is this time they're on their way out!"
In a politically polarized country where firearms are common and the murder rate is one of the highest in the world, tensions have risen alongside weeks of tough campaign rhetoric, and both camps are vowing to "defend" their votes.
CAPRILES WOULD FACE BIG CHALLENGES
Chavez accuses the opposition of plotting violence and planning to "reject the people's triumph" when he wins, but says that effort will be defeated. Some opposition activists fear he could refuse to step down if the result goes against him.
Victory for Capriles would remove the most vocal critic of the United States in Latin America, and could lead to new deals for oil companies in an OPEC nation that pumps about 3 million barrels a day and boasts the world's biggest crude reserves.
Capriles wants to copy Brazil's model of respect for private enterprise with strong social welfare programs if he is elected - but he would face enormous challenges from day one.
For a start, he would not take office until January 2013, meaning Chavez loyalists might throw obstacles in the way of the transition.
He also would have to develop a plan to tackle entrenched high inflation, price distortions and an over-valued currency, while surely butting heads with the National Assembly, judiciary and state oil company PDVSA - all dominated by Chavez loyalists.
Another big task would be to figure out the real level of state finances. Last month, a Reuters investigation found that half of public investment went into a secretive off-budget fund controlled by Chavez and had no oversight by Congress.
The president has denounced his foes as traitors and told voters they plan to cancel his signature social "missions," which range from subsidized food stores to programs that build houses and pay cash stipends to poor women with children.
Tens of thousands of new homes have been handed over this year, often to tearful Chavez supporters at televised events.
If Chavez wins, he can consolidate his control over Venezuela's economy and continue his support for leftist governments across Latin America, as well as allies farther afield such as Iranian President Mahmoud Ahmadinejad, Syria's Bashar al-Assad, and Alexander Lukashenko of Belarus.
Any recurrence of Chavez's cancer would be a big blow to his plan, however, and could give the opposition another chance.
The election will be watched closely in more than a dozen countries, including communist-led Cuba, which benefit from discounted oil sales from Venezuela.
Investors who have made Venezuela's bonds some of the most widely traded emerging market debt, are also on tenterhooks.
"Many investors have in recent weeks taken a more cautious/defensive tone," Goldman Sachs said in a research note. "There is a perception that a tight electoral outcome may trigger social and political unrest and market volatility."
Voting runs from 6 a.m. to 6 p.m. (1030-2230 GMT), although polls will stay open later if there are lines.
Results are due any time starting late on Sunday evening.
The electoral authority says it will only announce the results once there is an "irreversible trend" and parties are barred from declaring victory in advance of that announcement.
(Additional reporting by Deisy Buitrago, Mario Naranjo and Liamar Ramos; Editing by Andrew Cawthorne, Kieran Murray and Paul Simao)
(c) Copyright Thomson Reuters 2012. Check for restrictions at: http://about.reuters.com/fulllegal.asp