MOSCOW — Some of the loudest critics of President Trump's order to kill a senior Iranian commander — other than Iranians — are Russian officials, who have denounced it as an illegal assassination and a politically motivated election-year decision.

But it is Russia that may end up benefiting from the fallout. If the United States withdraws from Iraq as backlash over the killing widens, Russia could strengthen its foothold in the country — much as it did in Syria after Trump ordered a troop pullout there last fall, a step that was later partly reversed.

Speaking to French President Emmanuel Macron Friday, Russian President Vladimir Putin warned that Friday’s targeted killing of Maj. Gen. Qasem Soleimani would seriously destabilize the region. Russian Foreign Minister Sergei Lavrov cast it as illegal and counterproductive to his counterparts in China, Turkey and Iran, as well as to Secretary of State Mike Pompeo.

German Chancellor Angela Merkel will meet Putin in Moscow Saturday at his invitation, to discuss the crisis.

The strike could see the United States pulled deeper into Iraq to defend against threatened Iranian reprisals, despite its plans to draw down forces there and elsewhere. But the opposite could also happen: U.S. forces might pull out if the Iraqi government demands it, as Iraq’s parliament called on it to do Sunday. Or Trump might decide he does not want to risk a dangerous quagmire in an election year.

A hasty U.S. departure would give Iran what it has sought for years, analysts said. But they noted that it could also create a void for Russia to exploit, although it is more likely to do so through diplomatic overtures, trade deals and arms sales than by taking up any military slack.

“Under the circumstances of a forced and precipitous U.S. withdrawal, a power vacuum would emerge that would benefit Iran and Russia the most,” said Michael Carpenter, managing director of the Penn Biden Center for Diplomacy and Global Engagement and a former Pentagon deputy assistant secretary on Russia, Ukraine and Eurasia.

Richard N. Haass, president of the Council on Foreign Relations tweeted that the strike would see U.S. military and diplomats leaving Iraq, either because Iraq demanded it or they were too much of a target or both. “One sure result of the US strike is that the era of US-Iraq cooperation is over,” he wrote Friday, adding Monday that Trump’s “Truly counter-productive” threats against Iraq made it more likely U.S. forces would have to leave.

For Russia, there is a major difference between Syria, its decades-long ally, and Iraq, where the Kremlin’s footprint has been limited since the U.S.-led invasion in 2003. In Syria, President Bashar al-Assad asked Putin to intervene as the Islamic State and anti-government rebels threatened his power. When Putin agreed, many warned Russia could be bogged down in an intractable, expensive war that could make it more of a target for the extremists.

The man who argued Assad’s case to Russian defense and security officials — and convinced them the war was still winnable — was Soleimani, who traveled to Moscow in July 2015, unfurled a map of Syria on the table and explained what could be done to prevent Assad’s regime from falling, according to a Reuters report at the time citing a senior regional official. The following April, Reuters cited a senior Iranian official reporting that Soleimani met with Putin and Defense Minister Sergei Shoigu in Moscow to discuss deliveries of Russian missiles to Syria. According to media reports from 2015 to 2017, he traveled numerous times to Moscow in breach of a U.N. travel ban.

Moscow officials have never admitted that such meetings took place. But Soleimani’s mission paid off for Russia, saving its strategic naval base in Tartus on Syria’s Mediterranean coast. Russia also expanded its military foothold on Europe’s doorstep, gaining use of the nearby Hmeimim air base and establishing what some in NATO see as an air defense zone in the region.

Russia’s Defense Ministry sent condolences to Iran on Soleimani’s death and paid tribute to his “well-deserved authority and significant influence” in the region. “His personal merits in the fight against ISIS in Syria are undeniable,” it said in a statement.

Carpenter said Russian security officials worked well with Soleimani because they had values in common with him.

“They shared the same beliefs in neo-imperialism and power politics. Soleimani didn’t really fit the mold of a religious zealot or mullah,” he said. “The Russian intelligence and military apparatus could thus relate to him, and they also admired him for his shrewd strategic outlook and mastery of hybrid warfare.”

Putin’s strategic goals include rebuilding Russian power after its retreat in the 1990s; creating global alliances designed to counter U.S. influence; and inserting the country in strategic regions such as the Middle East as the party no one can afford to ignore.

He has shown willingness to take surprising risks to widen Russia’s geopolitical clout, moving into regions abandoned or neglected by the United States. But he is considered to be wary of trying to repeat his Syrian triumph in Iraq, even if invited. The United States’ long unhappy Iraq mission illustrates the move’s potential challenges.

Moscow’s relations with Baghdad have warmed in recent years. Diplomats meet regularly, announcing energy and arms deals. Russian energy giants Lukoil, Gazprom and Rosneft all operate in Iraq.

Eugene Rumer, former national intelligence officer for Russia and Eurasia and director of the Carnegie Endowment for International Peace Russia and Eurasia program, is skeptical that Russia would intervene militarily, even if U.S. forces do suddenly leave Iraq.

“If there was a fundamental breach between the United States and Iraq, I think it’s more likely they would use that moment diplomatically,” he said. “They might send in military advisers. They have sold weapons to Iraq and they might sell more. They might sign some trade deals.”

Russia would not be slow to exploit tension between Washington and Baghdad over the Soleimani killing, Carpenter said.

“A weakened U.S. relationship with Iraq allows Russia to cement its already-warming ties to Baghdad and augments Russia’s role as the premier power broker across the Middle East,” he said.

Russia’s view is that the strike was illegal under international law, because it took place without the permission of the host country and involved the killing of a senior official in a U.N. member state. The subtext of its message is about U.S. hypocrisy when it condemns Russian breaches of international law, for example in its 2014 annexation of Crimea. According to Anatol Lieven, an expert on global terrorism and the former Soviet Union based at Georgetown University’s campus in Doha, Qatar, the argument has traction in many places.

“Already across most of the world, including virtually all my own students from the Middle East, Africa and South Asia, people see no difference between U.S. and Russian international behavior when it comes to aggression, illegality and immorality,” he said.

Russian officials have also suggested that Trump’s real motive was political, as he faces impeachment in an election year.

“For the moment at least it takes the attention of the American media and international media away from things like Ukraine and Russian meddling and it puts the spotlight on President Trump as this erratic, not very responsible loose cannon who is prepared to do whatever it takes, not so much to protect the United States but to take away the spotlight from the impeachment trial and to change domestic dynamics. So I think this plays well for the Russians,” Rumer said. “It raises the question of the real rationale behind the strikes and it makes Putin look like the more responsible leader.”

If there is a regional crisis, Russia stands to benefit from increased global oil prices, although Lieven said Russia would not want to see prices go too high for too long.

“Assuming that Iran does strike back, then Saudi refineries, ports and tankers will definitely be targets,” he said. “The question is whether … Iran now has the capacity to inflict such massive damage that oil prices will rocket and stay high for a prolonged period, producing another global recession.”

Lieven said that higher oil prices would benefit Russia in the short term but added: “The lessons of the 1970s and 80s would tend to suggest that in the longer run, global recession brings prices down again very radically. Moreover, another oil shock would increase further moves in Europe and China to reduce dependence on oil.”