A military victory in Iraq and the opening of a diplomatic track in Syria suggest progress in creating the conditions to defeat ISIL. While much more needs to happen before the Islamic terror force is beaten, there’s reason for cautious optimism.

The retaking of Ramadi by Iraqi security forces is a strategic military advance after a series of humiliating defeats at the hands of ISIL. The victory has sparked hope that other ISIL-held cities, like Fallujah, also will fall. But beating ISIL in Mosul, Iraq’s second-most-populous city, would be more daunting.

Yet Ramadi proved it can be done, and adds credibility to the idea that the Obama administration’s plan of coordinating indigenous ground forces with U.S. air power might ultimately achieve the president’s stated goal to “degrade and ultimately defeat” ISIL.

The way to military victory was paved by a political decision to use Sunni tribal fighters as well as Iraqi security forces instead of Shiite militias tied to Iran. Iraqi Prime Minister Haider al-Abadi seems to understand that the heavy hand of his predecessor, Nouri al-Maliki, drove some Sunnis to support or at least accept ISIL. Accordingly, the follow-up in Ramadi will be crucial to convince more moderate Sunnis that their future is with a unified Iraq and their fight is against the nihilistic terrorists.

Defeating ISIL in Syria will be still more difficult, of course, largely because there is not a similar unifying force on the ground. Instead, there is the government of Bashar Assad, who has destroyed most of his country and destabilized the region and much of Europe with a resulting refugee crisis.

So it’s good news that on Dec. 19 the U.N. Security Council voted unanimously to support a resolution to bring Syrian government and opposition figures together “to engage in formal negotiations on a political transition process on an urgent basis” that within half a year would establish “credible, inclusive and nonsectarian governance” and establish a timeline for drafting a new constitution and holding new elections.

The rhetoric is a long way from the reality, however. It’s not yet determined who will constitute a legitimate opposition. And, most important, Assad has shown no willingness to cede power, and now he has Russian and Iranian military might to protect him. But in order to direct the fight against ISIL, it ultimately will be important for Assad to exit. So U.S. policy should still be to push for a political transition in order to convince Syrian Sunnis to fight back against ISIL.

“There can be no real stable solution to this Syrian crisis until Assad moves on,” Ambassador Frederic C. Hof, a senior fellow at the Atlantic Council, told an editorial writer. “Assad’s survival strategy, which is centered on mass homicide and nonstop attacks on civilians, is one of the principal factors which have allowed ISIL to take root in Syria … particularly as the Western world stands aside and watches this happen.”

There’s still much that can go wrong, and Hof warns about a “race against time” before another ISIL-inspired attack like the one in Paris. And even if ISIL is defeated, other groups, including an insurgent Al-Qaida, await. But recent events show that given political will and superior military means, ISIL and other terrorists can be beaten.