Hours before Iran launched a missile attack on U.S. troops in Iraq, Vladimir Putin visited Syria to huddle with his Syrian counterpart Bashar al-Assad over the mounting U.S.-Iran crisis. Russia has repeatedly condemned the U.S. airstrikes that killed Iranian Major Gen. Qassem Soleimani. It’s fair to assume that leaders in Moscow are seeking to turn the situation to their advantage.

Relations between Washington and Tehran have deteriorated since the onset of the Syrian conflict and even more so since President Donald Trump’s withdrawal from the 2015 nuclear deal. At the same time, Russia and Iran have grown closer through military cooperation in Syria. Moscow’s expanding influence in Syria suggests that a conflict between the United States and Iran could advance Russia’s power and reputation in the region. At the very least, Russia will be able to paint the United States as an erratic aggressor, leading regional actors and international allies to question cooperation with Washington.

Russia has helped the Assad regime maintain control in Syria, even as the U.S. and its NATO allies demanded Assad’s ouster. As the U.S. pulls back from Syria, Assad and Russia remain in control. Russia’s backing of Assad began as a quest to undermine U.S. interests and gain influence in the Middle East. More than four years later, Russia’s triumphs from that conflict include drawing Turkey away from its NATO allies, building a reputation as a valuable foreign backer, and emerging as a kingmaker—all at the expense of the United States.

The Soleimani strike contributes to Russia’s goals of driving a wedge between Washington and its partners and advancing global perceptions of the United States as volatile and belligerent.

Poorly reasoned U.S. foreign policy decisions, such as, most recently, abandoning Kurdish partners in Syria, helped create a power vacuum that Russia has stepped in to fill. Friday’s strikes—and every Trump administration action taken since—will likely improve Russia’s position in Syria and the broader region. Iraq’s government is outraged by what it views as a U.S. violation of its sovereignty, with the Iraqi prime minister calling the strike a “flagrant violation of the conditions authorizing the presence of U.S. troops.” Iraq could soon expel U.S. forces from the country in response. With no troops in Iraq, the United States will find it hard to sustain a presence in Syria. That void would create more maneuverability for Moscow in the region—essentially, cementing its position as a regional power broker.

Beyond strengthening Russia’s position, the Soleimani strike contributes to Russia’s goals of driving a wedge between Washington and its partners and advancing global perceptions of the United States as volatile and belligerent. Moscow has already succeeded in undermining U.S. relations with Middle Eastern allies. The prime example is Turkey: Although Russia and Turkey were on opposite sides of the conflict in Syria, they now jointly control operations in the north of the country after a remarkable Oct. 22 agreement between Washington and Ankara to establish a “Syria Safe Zone” and the withdrawal of U.S. troops. In reaction to Soleimani’s death, Turkey released a statement that it opposes “foreign interventions, assassinations and sectarian conflicts in the region.”

Moscow could also benefit if the U.S. strikes create more disunity between Washington and its European allies. Numerous U.S. decisions in the Middle East have frustrated allies, particularly its withdrawal from the nuclear deal. Reports suggest that the Trump administration even failed to warn Britain and other allies ahead of the strikes on Soleimani. If Washington does not heed its allies’ calls for immediate de-escalation, the United States could find itself further isolated on the world stage.

Washington could incur additional damage to its relationships with European allies if Iran now hastens its pursuit of a nuclear weapon as a result of the strikes. Iran announced Sunday it would stop obeying all restrictions imposed by the Iran deal on its nuclear activities. Russia has been a vocal critic of the U.S. decision to withdraw from the deal and instead mount a “maximum pressure” campaign against Iran. In fact, Moscow’s position has placed it on the same side as European powers like France and Germany opposing the U.S. decision to reimpose sanctions. Russia has worked with France and Germany to sidestep U.S. sanctions to keep Iran in the deal. Consequently, Russia is ideally situated to emphasize its efforts to maintain the agreement and blame Washington for pushing Iran toward a nuclear bomb.

Of course, there are major downsides for Russia from a U.S.-Iran conflict in the Middle East. A proxy conflict could stress Russian forces in Syria, especially if Israel escalates its strikes against Iranian-backed groups like Hezbollah, which vowed to revenge Soleimani’s death. Furthermore, any Iranian progress toward nuclear breakout surely would destabilize the region, complicating Russia’s ability to control the situation in Syria. Finally, if Russia cooperates too closely with Iran, it will attract criticism from other Middle Eastern partners.

For a while it seemed that Trump was trying to fulfill his campaign promise of a reduced U.S. presence in the Middle East. Now, it seems as if he’s trying to draw the country into another prolonged quagmire—whether as a distraction from impeachment proceedings or to force Iran to the negotiating table, it is too early to tell.

Russia, on the other hand, is left with the enviable position of capitalizing on the turbulent behavior of the United States in the Middle East, regardless of whether the United States and Iran go to war. Ultimately, U.S. actions will strengthen Russian leadership: first, by removing American competition, and second, by turning regional and global sentiment against the United States. Provided Moscow continues cooperating with all regional states and maintains stability in Syrian territory where Russian forces are present, Russia stands a good chance of supplanting U.S. influence in the Middle East—no matter what happens next.