By Andrew Cawthorne and Daniel Wallis

CARACAS (Reuters) - Venezuelan President Hugo Chavez's cancer operation in Cuba on Tuesday was a success, his vice president said, adding that the complex surgery had lasted more than six hours and he would be recuperating for several days.

The 58-year-old socialist leader's third bout with cancer in the past 18 months has thrown his presidency into jeopardy and upended politics in the South American OPEC nation.

"Once again, our comandante has shown his strength," Vice President Nicolas Maduro said in a broadcast on state television as members of the government alongside him applauded.

"We want to thank the Venezuelan people for all the love they dedicated so this operation was completed correctly and successfully," said Maduro, whom Chavez has named as his successor if he is unable to stay in power.

Maduro said the post-operative phase would last several days. "We can say the president has beaten the first obstacle and now, with his medical team, he will go on recuperating."

Chavez's surgery in Cuba, a close ally, was his fourth since mid-2011. Doctors found malignant cells again in his pelvic area soon after he comfortably won re-election in October.

Chavez had twice declared himself cured, only for the cancer to return. He has said he still hopes to recover from this operation in time for the January 10 start of a new six-year term in office.

He named Maduro on Saturday as a potential heir to lead his self-styled revolution in a nation of 29 million people with the world's largest oil reserves.

The move irked some in Venezuela's opposition, who say voters - not Chavez - would decide who follows him if he were forced to step down and an election was held within 30 days, as required under the constitution.

'RIGHT TO KNOW'

Should an election be held, opposition flag-bearer Henrique Capriles, who lost to Chavez in the October presidential ballot but scored a record 6.5 million votes for the opposition, could have a second crack at power.

In a newspaper interview on Tuesday, Capriles declined to speculate on a possible new presidential bid and repeated his best wishes to Chavez for a quick recovery. But he criticized the secrecy surrounding the president's treatment.

"Venezuelans have the right to know," he said.

Maduro said Chavez was surrounded by family and top government officials in Havana, where he is a guest of his friend and political ally, former Cuban leader Fidel Castro.

The vice president criticized attempts to manipulate news of the president's health for political gain, saying: "Stop spreading hatred and poison every day. Respect the president and respect the sadness of the people, who this man has freed."

The stakes are high for Cuba and other socialist-run nations across Latin America and the Caribbean that depend on the Chavez government for subsidized oil and other economic aid.

Messages of support have poured in from allies.

"He changed the history of Venezuela and much of Latin America," said Ecuador's president, Rafael Correa, a member of the Chavez-led bloc of leftist nations in the region.

"He's in good spirits. You know what Hugo's like, always ready for tough battles with optimism and faith," Correa said of Chavez before the operation. "I'm not going to lie, we are very worried."

U.S. actor Sean Penn, one of Chavez's most prominent international supporters, joined a vigil in Bolivia. "He's one of the most impressive forces on the planet and we need to show him our love," Penn was quoted as saying by local media.

Cancer experts warned that the recurrence of Chavez's disease was bad news.

"The chances for long-term recovery are highest the first time around, when you attack a cancer with surgery and chemotherapy. Whenever a cancer recurs, your chances for a long-term positive outcome decrease," said Dr. Axel Grothey, an oncologist at the Mayo Clinic in Rochester, Minnesota.

Grothey has not been involved in the president's treatment, but said he had seen many patients in a similar situation.

INVESTORS WATCH

Maduro, 50, a former bus driver and union activist, lacks his boss' charisma and political flair but would represent policy continuity should he take over. He has already taken control of day-to-day government business.

Chavez's health woes had sparked a rally in Venezuela bonds, given many investors' preference for a more business-friendly government in Caracas. Gains were trimmed slightly on Tuesday.

Western investors have increasingly shunned Venezuela under Chavez - especially given his nationalizations of large swaths of the economy - giving companies from China, Russia, Iran, Belarus and other allies a chance to grab footholds.

In London, emerging market investor Mark Mobius said any change to a more market-friendly government in Venezuela would encourage him to invest there once more.

In a research report, Nomura said the market should temper its enthusiasm in the medium term, saying the impact of Chavez's blessing of Maduro should not be underestimated if a new election were held.

"Second, the situation inside the opposition is not a bed of roses, as there are ongoing contradictions and a certain lack of morale," it said, adding that Capriles was beaten heavily on October 7.

The health saga has once again eclipsed major national issues such as state elections on Sunday, a widely expected devaluation of the bolivar currency and a proposed amnesty for Chavez's jailed and exiled political foes.

Venezuelans were expecting a currency devaluation around the New Year, although Chavez's illness has put that in doubt.

(Additional reporting by Caracas bureau, Eduardo Garcia in Quito, and Julie Steenhuysen in Chicago; Editing by Kieran Murray and Peter Cooney)