At the start of this year, Iran’s long dalliance with Russia seemed to be paying dividends. Economic mismanagement and drought had combined to yield an 8 million ton shortfall in Iran’s need for basic foodstuffs. Russia, the world’s largest exporter of grain, appeared poised to swoop to the rescue, as the two countries neared an agreement for 10 million tons of grain and edible oils.

Instead, Iran’s food shortages and its appeal for Russian help have proved a warning to those counting on Russian stability. In the wake of Russia’s most recent and biggest invasion of Ukraine, Iran’s food shortage has become acute and the country now faces serious popular volatility. While Iran’s own policies are mostly to blame, the Russian invasion, and by extension, Iran’s reliance on Russia, was the direct catalyst.

In July, Iran elected its most pro-Russian president in a decade. Ebrahim Raisi — infamous in the West for ordering the mass execution of political prisoners — inherited a country roiled by mass protests, a catastrophic COVID response, and a faltering economy. Mass protests had erupted in 2017 when the benefits of sanctions relief through the Joint Comprehensive Plan of Action (JCPOA), which limited Iran’s nuclear program, flowed overwhelmingly to the elite, especially those connected to the Iranian Revolutionary Guard Corps.

With American withdrawal from the agreement under President Trump, economic hardship rocketed while the government’s capacity to provide basic goods plummeted. Rises in gas prices and water shortages, along with longstanding grievances from Arab, Kurdish, and Baloch minorities, brought millions to the streets. The government response, as always, left thousands dead.

Raisi promised a restoration of order and economic stability. The country’s massive food subsidy program ate up $100bn of the state budget, while the resulting market distortion crippled Iran’s domestic growers and importers. Supreme Leader Ali Khamenei called for “complete self-sufficiency and security in basic food products,” and politicians of all stripes agreed the path to that goal lay in abolishing the subsidy. With an already restive population, this move would demand of Raisi a precarious balancing act.

Russia’s unprovoked invasion of Ukraine made that near-impossible. Wheat prices spiked 40% in a month. Price-controlled import wheat could be bought in Iran and sold for more than 10 times its purchase price in neighboring countries. The result, according to Iran’s Agriculture Minister, was that “physical prevention of smuggling is not very possible.” The minister estimated that a single unnamed neighbor, presumably Afghanistan or Iraq, was planning to smuggle 3 million tons of foodstuff from Iran, more than the difference between the shortfall and new imports from Russia.

Raisi was left with little choice but to expedite the reform and on May 1 removed the import subsidy. Wheat prices immediately rose sixfold. Protests erupted in Khuzestan, a largely Arab, oil-producing province in the southwest. The government shut down the internet in the province, but the unrest has spread in recent weeks into the Persian heartland, with few signs that it is abating. With grim predictability, the regime is falling back on its established tactics of killing protesters.

Russia responded to the situation by reducing its export commitment to 5 million tons. Hit with wide-ranging sanctions, Russia has limited wheat shipments, while its attacks on Ukrainian grain infrastructure and blockading of Ukrainian exports have kept prices high.

It is true that the shock to oil prices has given the Iranian regime a boost, a rare dividend for Russian allies. But filling coffers have been outweighed by the immense costs of Iran’s reliance on Russia as a reliable and predictable ally. A stalwart regional ally, Iran had asked little of the Kremlin beyond upholding its agreements — both with Iran and its European neighbors. Other Russian allies should perhaps take note; even this low bar is beyond the Kremlin’s reach.

Ben Dubow is a Nonresident Fellow at CEPA and the founder of Omelas, which specializes in data and analysis on how states manipulate the web.