Something wasn’t quite right, Hugo Chavez recounted. And the Venezuelan president’s mentor, 84-year-old Fidel Castro, noticed straight away.

“What’s wrong with you?” Castro asked. The Cuban leader urged Chavez to stand up and looked him over with what the Venezuelan populist called Castro’s “eagle eyes.” “Where’s the pain?”

Castro then “began to question me, like a father questions a son,” Chavez said in his account of their meeting in Havana last month; he said he “confessed” his ailments as if he were Castro’s patient.

At the Cuban revolutionary’s insistence, Chavez then went under the scalpel to remove a malignant tumor. Later, Castro brought peanut butter he himself had made and gabbed with a recovering Chavez about world affairs. “Fidel is like a saint,” Chavez told Cuban state television.

The outsize role that Castro has played in Chavez’s ordeal with cancer has brought into sharp relief not only the personal, even paternal nature of their relationship, but also how vital Chavez’s health is to Cuba’s archaic communist system.

The links the two leaders have forged are based on heartfelt kinship, Chavez’s government says. But the Cubans also have a lot riding on Chavez, who on Wednesday announced that he may undergo chemotherapy or radiation treatments. Since taking office in 1999, Chavez has shipped tens of billions of dollars in subsidized oil to the island.

“For the Cubans, this is not just an ideological friend and ally — he’s a lifeline for the island economy,” said Moises Naim, a Venezuelan who is a senior associate at the Carnegie Endowment for International Peace in Washington. “It’s a matter of regime survival to ensure that a Cuban-friendly government is in power in Venezuela.”

The friendship between the two men, who are separated by 28 years in age but share ideological affinities that include antipathy for the United States, has periodically been on display over Chavez’s 12 years in power.

In 1999, before Castro’s own health began to deteriorate, the two played baseball together before 55,000 spectators, appeared on Chavez’s “Hello President” TV show and even sang folk songs (Chavez has the upper hand as a crooner).

In 2002, when Chavez was briefly ousted, Castro marshaled the support of Latin American presidents to help weaken the coup plotters who had seized power. More recently, as U.S. diplomatic cables made public by WikiLeaks show, Cuban intelligence officers operating in Venezuela have directly provided information to Chavez, unfettered by Venezuelan officers.

The bond is so tight, in fact, that Chavez’s former common-law wife, Herma Marksmen, told American diplomats that Chavez confides in only two people, Castro and his elder brother, Adan.

Here in Venezuela, some of the trappings of Cuba’s system are clearly evident: a powerful state propaganda apparatus; the state seizure of companies; the spread of fervent, pro-government neighborhood groups; and the use of the military slogan “Fatherland, socialism or death!”

But in spite of the revolutionary partnership, Venezuela clearly plays the more important role. With huge oil reserves, it replaced the benefactor to Cuba that was lost with the Soviet Union’s breakup two decades ago. The 100,000 barrels of oil Cuba receives each day literally keep the lights on, particularly vital now as the Cuban government tinkers with economic liberalization measures to stay afloat.

“So if, let’s just say the Venezuelan subsidy ended for whatever reason, Cuba would have a pretty short window — probably weeks, no more than a month or two — to make some very, very severe adjustments,” said Brian Latell, a former CIA analyst and the author of “After Fidel: The Inside Story of Castro’s Regime and Cuba’s Next Leader.”

So Chavez’s ailment, made public in a carefully orchestrated speech from Havana, was quickly felt across Cuba, which had already seen Castro hand over the presidency to his brother, Raul, in 2006 after being sidelined by an intestinal illness.

Venezuelan oil allows Raul Castro to “buy time in the face of citizen discontent,” Yoani Sanchez, the author of the Havana-based blog Generation Y, wrote this month, while the loss of Chavez “could hasten Raul’s own downfall.”

While some Cuba experts disagree with such a dour scenario, there is no doubt that Fidel Castro made sure Chavez got the best of care.

When the surgery was over, Castro brought treats such as lamb and tilapia. He was so pleased by Chavez’s recovery, the Venezuelan president recalled, that Castro appeared “luminous, joyous, optimistic.”

Chavez, who returned to Caracas last week, has yet to reveal what kind of cancer he has. But speaking on Cuban television, he was emphatic about Castro’s role.

“If not for Fidel,” Chavez said, “who knows where or in what labyrinth I would be in now.”

Liebendorfer, a special correspondent, reported from Bogota, Colombia.