Hugo Chavez loyalists blew bugles in a wake up call for voters on Sunday as the Venezuelan leader faced 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 the president's 14-year tenure.

Chavez has used record oil revenue to support ideological allies around the world while preaching a fiercely anti-American line, so the election is being watched eagerly from the United States to Belarus and Iran.

Queues formed at some polling centers long before they opened, and despite a few delays voting was going smoothly.

"The battle has started!" the flamboyant former soldier wrote in an early morning rallying cry on Twitter. "Today we will write another chapter in history."

Chavez loyalists in poor neighborhoods, where he draws his most fervent following, blew bugles and trumpets in the predawn wake-up call. In the center of Caracas, some red-clad fans shouted "Long live Chavez!" from the back of trucks.

Chavez, 58, 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.

"Today we decide the future of our Venezuela," Capriles said on Twitter. "Today we are millions of Davids! God will be our guide," he added, referring to his depiction of the vote as the biblical underdog's battle against Goliath.

Capriles had prepared for the election by hiking a mountain trail on the edge of Caracas on Saturday, donning sports gear and mirrored sunglasses and posing for pictures with supporters.

Opposition supporters had banged pots and pans in an overnight protest against the president in parts of the capital.

"Today I'm doing my bit to build a new Venezuela," said Francesca Pipoli, 26, walking to vote with two girlfriends in the city's wealthy Sebucan district. "Capriles for president!" all three sang in the street. "Henrique, marry me!" said one.

NO FORMAL MONITORS

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 are no formal international observers, but a delegation from the UNASUR group of South American nations, led by an Argentine politician, is in Venezuela 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.

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.

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.

OBSTACLES TO ANY TRANSITION

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 big challenges from day one. For a start, he would not take office until January 2013, meaning Chavez loyalists could throw obstacles in the way of the transition.

He would also 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 "Chavistas."

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 that is controlled by Chavez and has 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 plans, however, and could give the opposition another chance.

The election will also be watched closely in more than a dozen countries, including communist-ledCuba, that benefit from discounted Venezuelan oil sales under Chavez.

Investors who have made Venezuela's bonds some of the most widely traded emerging market debt are on tenterhooks.

"There is a perception that a tight electoral outcome may trigger social and political unrest and market volatility," Goldman Sachs said in a research note.

Voting runs from 6 a.m. to 6 p.m. (1030-2230 GMT), although polls will stay open later if there are still queues. 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.