Cuba’s former Soviet ally recently threw the island’s ailing economy a lifeline. On May 10, a tanker carrying 250,000 barrels of Russian oil arrived in Matanzas, some 60 miles east of Havana. It was Russia’s first shipment of refined oil to Cuba in decades, after being the country’s principal fuel supplier through the Cold War up until the Soviet Union’s collapse in 1991. For much of the period between then and now, Venezuela filled the void, becoming Cuba’s top fuel supplier in 2003, and sending the island an average 105,000 barrels of oil daily between 2007 and 2014. But Caracas’ crippled economy and tumbling production has forced it to cut down daily oil exports to Cuba to 55,000 barrels this year. Now Russia is back, with the first fuel shipment that’s part of an overall 1.9 million barrels of oil that Rosneft, the Russian state-owned oil company, will send to Cuba.

But the revival of Russia-Cuba ties go past oil. Last year, a Russian official spoke about the possibility of reopening a military base there, and the countries have been signing a plethora of investment deals over the last three years. Here’s how relations between the countries have been evolving.

Oil dealings

The 1.9-million barrel deal between state-owned enterprises Rosneft and Cubametals is worth about $105 million. Cuba produces about 50,000 of its 165,000 barrels per day consumption rate on its own. Though there are no details for how Cuba will pay for the oil, its most likely that Rosneft gave the country preferential or subsidized rates, “which the market would not otherwise bear,” according to Moody’s. Given Cuba’s sluggish economy, which contracted 0.9 percent in 2016, the deal would have to be similar to Venezuela’s preferential oil arrangements with Venezuela, for which Cuba exchanged the services of 40,000 professionals (a value of about $5.4 billion), though large numbers of the Cuban medics have left Venezuela amid the crisis. Russia’s economy, too, is just beginning to recover and cannot afford gifting the oil to Cuba, says Carmelo Mesa-Lago, a Cuban economist.

It’s also not clear whether the deal will be extended, but if the situation in Venezuela continues to deteriorate, Cuba will need more help. The island began rationing electricity in the summer of 2016, reducing its daily fuel consumption by 12,000 barrels, and, in April, started restricting the sale of premium gas to government officials and diplomats, whose modern cars are among the few to rely on high-octane fuel.

Military cooperation

When it comes to military ties, Cuba and Russia also have history, and recent agreements are renewing that bond. In December 2016, the two countries signed an agreement to help modernize Cuba’s defense industry through 2020. The deal ranges from Russia providing military advice to maintenance of Cuba’s stockpile of Soviet-era weapons. The deal, however, does not include any new arms sales.

Earlier in 2016, Russian Deputy Defense Minister Nikolai A. Pankov told his country’s national parliament about plans to reestablish a military base in Cuba that Moscow closed in 2002 due to budget issues. But another Russian official denied there were any such plans in motion.

Economic partnership

Cuba and Russia are also cooperating on 55 projects, with about $4 billion in Russian investments going toward infrastructure and other economic development plans. Russia’s investments are part of a 2014 deal that waived 90 percent, or $29 billion, of Cuba’s Soviet-era debt, and required the remaining amount to be invested in the island. Moscow plans to invest a little over a $1 billion to update Cuba’s rail system through 2030, a project led by Russian company RZD International. The parties are set to officially sign the deal by the end of 2017.