People gather outside the Cuban embassy in Santiago, Chile on Nov. 26, 2016, the day after Cuban revolutionary leader Fidel Castro died at age 90. (MARTIN BERNETTI/AFP/Getty Images) (Martin Bernetti/AFP/Getty Images)

On every stage where a Latin American leader launched into soaring oratory against the imperialists, ­Fidel Castro was present.

In every lonely jungle hideout where guerrillas in olive-drab plotted their fight, Castro kept them company. In every country where revolutionaries and communists dreamed of creating a workers’ paradise, Castro was a guiding light.

No single figure did more to define generations of Latin Americans who sought political upheaval than Castro. His anti-American rants inspired followers in countries that also saw resources sucked away by local elites in cahoots with the mighty United States. In nations with extreme inequality, governments took lessons from his state-run economic model. For modern-day strongmen looking for high-minded justifications to seize control of parliaments, courts and the media, he was the man.

These days, many Latin American countries’ political and economic ties with Cuba have weakened because of painful recessions and voters’ rejection of leftist governments. Leftists in Latin America have little interest in armed revolution anymore. Still, Cuba’s influence in the region endures, both because of its advances in education and health care, and because of its example of fierce independence.

“Yesterday the greatest of all Latin Americans died,” former Brazilian president Luiz Inácio Lula da Silva wrote on his Facebook page Saturday.

The mood in Havana was somber the morning after Fidel Castro died. Just 90 miles away in Miami, the scene was much different. (Jason Aldag/The Washington Post)

In the 60 years since Castro and his comrades sailed to Cuba from the coast of Mexico to launch their unlikely rebellion, his story has been an example for leftists in the region who took up arms against their governments.

Some, like Castro, transitioned to political leadership and pressed for greater spending on the poor. Dilma Rousseff in Brazil and José Mujica in Uruguay fought against military dictatorships before eventually becoming presidents, while current leaders such as Daniel Ortega in Nicaragua and Salvador Sánchez Cerén in El Salvador were prominent guerrillas in Cold War battles against U.S.-backed regimes.

“Dreamers and progressive militants, everyone who fights for social justice and for a less unequal world, we all woke up sad this Saturday,” Rousseff wrote on her blog.

Castro’s Cuba provided moral support for small Latin American countries pushing back against institutions such as the World Bank and the International Monetary Fund that wanted painful austerity measures. When Colombia’s main rebel group, the Revolutionary Armed Forces of Colombia (FARC), needed a place to talk peace in recent years with that country’s leaders after a half-century of war, they found it in Cuba. While the “pink tide” of leftist governments that swept across Latin America in the early 2000s has ebbed, with more-conservative leaders taking power in several countries, Castro’s followers and allies are still a force in the region.

One can see Castro’s shadow in places such as Evo Morales’s Bolivia and Rafael Correa’s Ecuador. These long-serving South American leaders, who consider Castro an inspiration, have distanced their countries from the United States, overseen constitutional changes that extended their rule, and spent heavily on welfare programs in the name of a “21st-century socialism.”

Morales, a former coca grower who rose to prominence opposing U.S.-funded eradication efforts, has described Castro as a “father,” and analysts think the Cuban’s example helped Morales broaden his message beyond the coca fields. On Saturday, Morales choked up as he paid tribute to Castro.

Fidel Castro, the Cuban dictator who led the country's communist revolution in the late 1950s, died on Nov. 25. (Jason Aldag/The Washington Post)

“He accompanied us,” Morales said. “He guided us. Fidel oriented us and the Cuban people to raise our voices against those who imposed the politics of domination . . . to ransack our natural resources.”

While Castro is a symbol across Latin America, few places still try to replicate his Soviet-
inspired economic system. One exception is Venezuela, an oil-producing country that instituted its own socialist model after former military officer Hugo Chávez came to power in 1999. When Chávez died in 2013, Castro described him as “the best friend Cuba ever had.”

Chávez’s government modeled its health-care and literacy programs on Cuba’s. While Venezuela shipped cheap oil to the island, Cuban doctors and teachers fanned out into poor neighborhoods of Venezuela to teach and provide medical care.

“Cuban support was fundamental for developing [these] social programs,” said Nicmer Evans, a Venezuelan political analyst.

The Chávez government’s heavy subsidies for such things as milk and corn flour helped poor Venezuelans in times of high oil revenue but are difficult to sustain now that petroleum prices have slumped. The country is suffering extreme shortages of food and medicine, rampant inflation and growing social unrest. Chávez’s successor, Nicolás Maduro, is fighting off an opposition effort to oust him from the presidency.

In other parts of Latin America, Castro’s influence has been more symbolic. In Mexico, student activists still wear hats and T-shirts featuring pictures of Cuban revolutionaries. But Castro has generally been seen by Mexican politicians as a convenient friend rather than someone to emulate.

Most Latin American countries cut diplomatic ties with Cuba after Castro’s revolution, while Mexico recognized the new regime in the face of stiff U.S. resistance. Mexico, though, was using its diplomatic tools more to gain leverage with the United States than to pursue Cuba-style policies.

“There was always this idea in Mexican diplomacy that they supported causes that were against the United States in order to negotiate with the Americans,” said Ilán Semo, a historian at the Ibero-American University in Mexico City.

While Cuba helped foment rebellion in other Latin American countries in the 1960s, ’70s and ’80s, Castro resisted doing that in Mexico.

Several countries with ­socialist-inspired leaders, such as Chile’s Michelle Bachelet and Brazil’s Lula and his successor, Rousseff, had good relations with Cuba but pursued more market-friendly economic policies while expanding social programs.

While Castro’s economic approach has lost popularity, Latin American countries remember him more for his focus on health care, education and better conditions for the poor.

“For the peoples of our continent and the workers of our poorest countries, especially for the men and women of my generation, Fidel was always a voice of struggle and hope,” Lula wrote.

Cid Benjamin, a former member of an armed Brazilian leftist group in the 1960s, considers himself part of a generation “formed by the influence of the Cuban revolution.”

He now sees Cuba’s health and education systems as Castro’s most important regional legacies.

“It has an influence on the whole left,” Benjamin said. For years, Cuba has sent doctors and teachers to provide services in countries such as Venezuela, Brazil and Angola, earning hard currency in the process.

Under Rousseff, Brazil brought in 11,000 Cuban doctors to work in gritty suburbs and isolated rural areas, where ­middle-class Brazilian doctors were often reluctant to practice. It’s a Cuban legacy a generation of poorer Brazilians is unlikely to forget.

Partlow reported from Olympia, Wash. Mariana Zuñiga in Caracas, Venezuela; David Agren in Mexico City, Simeon Tegel in Lima, Peru; and Julia Symmes Cobb in Bogota, Colombia, contributed to this report.