THE FINAL capture of the Islamic State's de facto capital of Raqqa this last week by U.S.-backed Syrian forces brings the would-be caliphate to the brink of extinction: It has lost 87 percent of the territory it once controlled in Iraq and Syria and probably will soon be driven from the rest. But the terrorists' defeat raises complex challenges for the United States in Iraq and Syria, where Iran and Russia are entrenching their forces and consolidating influence at the expense of U.S. allies. If there is a countering American strategy, it isn't evident.

While gratuitously undermining the Iran nuclear agreement, President Trump promised that the United States would resist Iranian aggression in the region. Yet the administration remained passive as Iranian-led militia forces helped the Iraqi army push U.S.-allied Iraqi Kurds out of the disputed city of Kirkuk and nearby oil fields; Mr. Trump said the United States was neutral in that fight. On Syria, Washington appears content to step aside as Russia and Iran work to restore the authority of the blood-soaked regime of Bashar al-Assad — and consolidate bases for themselves.

During the fight for Raqqa, the Russia-Iran-Assad coalition recaptured territory on the other side of the Euphrates River, including the towns of Deir al-Zour and Mayadin. It is winning what has been a race to grab territory in eastern Syria, including the country's main oil fields. And unlike Washington, Moscow and Tehran clearly intend to continue backing their allies once the Islamic State is wiped out. Rather than remain in Syria, the State Department says, the plan is to "turn [Raqqa] over to other countries and the host country" — which probably means Russia, Iran and the Assad regime.

Moscow has managed to draw Syria's neighbors into its pacification scheme. Last month Turkey agreed to a deal to help end the fighting in the northwestern province of Idlib, much of which is controlled by an al-Qaeda-linked coalition. In recent days, Turkish forces have been advancing into territory near the Turkish border. It remains to be seen whether the Turks will confront the extremist forces or turn on the U.S.-allied Kurds; for now they appear to be negotiating with al-Qaeda.

Left out of this emerging new order is Israel, whose strong objections to what Prime Minister Benjamin Netanyahu calls Iran's incipient "military entrenchment" in Syria have been brushed aside by Russia. Israel recently stepped up its own military action to stop an Iranian buildup, bombing sites deep inside Syria. Yet while Mr. Trump's disavowal of the Iranian nuclear accord pleased Mr. Netanyahu, there is no sign of U.S. intent to arrest the more imminent Iranian threat to Israel in Syria.

Mr. Trump may believe he can extract the United States from Iraq and Syria without harming strategic interests. If so, he is repeating the mistake of President Barack Obama. A failure by the United States to defend its allies or promote new political arrangements for the two Arab states will lead only to more war, the rise of new terrorist threats and, ultimately, the necessity of more U.S. intervention.