After the Syrian Army recaptured the city of Palmyra from the Islamic State group at the end of last month, U.S. State Department spokesman John Kirby admitted that the liberation of the ancient city was a “good thing”. But he could not resist adding: “We’re also mindful, of course, that the best hope for Syria and the Syrian people is not an expansion of [President] Bashar Assad’s ability to tyrannize the Syrian people.”

This was entirely in line with the long-standing U.S. policy of seeking to destroy both Islamic State and the Syrian government (i.e. the Assad regime) at the same time. But that was never more than wishful thinking, especially as the United States was quite sensibly determined not to commit its own ground troops to the conflict.

If the Syrian Army actually had collapsed (as was looking quite likely before the Russians intervened to save it last September), nothing could have prevented Islamic State and the rival Islamist forces of the Nusra Front from taking the whole country. They might then have fought each other for control, but all of Syria would have ended up under extreme Islamist rule.

But the opposite is not true. The revival of the Syrian Army, and even its reconquest of Palmyra, does not mean that the Assad regime can destroy Islamic State, let alone regain control of the whole country. Nor does Russia have any intention of helping President Assad to pursue such an ambitious goal, as Moscow made clear by withdrawing most of the Russian combat aircraft from Syria two weeks ago.

Russia’s strategy has been more modest and realistic from the start. It was to restore the military stalemate that had persisted until the spring of 2015, and to convince the remaining non-Islamist rebel groups that they had no chance of somehow riding to power on the coat-tails of an Islamist victory over the Assad regime.

This hope was as delusional as the American policy in Syria. By mid-2015 between 80 percent and 90 percent of the Syrian rebels actively fighting the Assad regime belonged to Islamic State or to al-Qaida’s Syrian franchise, the Nusra Front, and its Islamist allies in Ahrar al-Sham. Moreover, the remainder of the rebels, the non-fanatics or so-called “moderates,” were mostly allied to the Nusra Front.

This curious alliance came to pass mostly because the Nusra Front wanted to avoid the American and “coalition” bombs that were falling on Islamic State. So it created a broader alliance called the “Army of Islam” that wrapped these small “moderate” groups around the Islamist core, and the U.S. fell for it. Or at least American propaganda fell for it.

The Russians cheerfully bombed all these forces indiscriminately, making no distinction between Islamists and the allies of Islamists. The U.S. ritually condemned the attacks on the latter groups (always described as “moderates”), and the Russians cheerfully ignored that too.

And after five months, when most of the “moderates” had been persuaded that they were never going to gain power through an alliance with the Islamists, Moscow proposed a ceasefire that would include the “moderates” but exclude the Islamists. That ceasefire has now been in effect for almost a month.

The negotiators for these “moderate” groups are still demanding the departure of Assad from power as the price of a permanent ceasefire. They haven’t a prayer of getting such a sweet deal, but the Russians are putting pressure on Assad to come up with a formula of words, however vague, that will persuade the “moderates” to accept amnesty and come in from the cold without losing too much face.

The Islamists, although largely surrounded and blockaded, will not be defeated any time soon by military force, but they are growing weaker and may fall to fighting among themselves.

And the Syrian Kurds, the only American allies on the ground in Syria, will probably manage to hold on to the long strip of territory they control along the border with Turkey. However, they may have to settle for being an “autonomous province” within Syria if they wish to avoid a Turkish invasion.

Russian President Vladimir Putin’s goal was to isolate the Islamists and reconcile the rest of the rebels with the Assad regime, and it is well on the way to accomplishment. It will not be a happy ending for any of the groups involved in the Syrian civil war, but it is the least bad outcome that can now be realistically imagined.

It will not put an end to all the fighting on Syrian territory. Not all the refugees will want to come home to such a country, and the terrorism abroad will continue. (But then, it would continue even if Islamic State disappeared — you don’t need a state to plan terrorist attacks.)

When no decisive victory is possible for any side, it makes sense to stop as much of the shooting as possible.

Gwynne Dyer is an independent journalist and military historian whose articles are published in 45 countries.