The retaking of Ramadi by Iraqi security forces this past weekend was a blow to Islamic State. It’s less clear that it amounts to a major victory for the government in Baghdad, but it at least shows that its U.S.-backed strategy for recapturing territory in Sunni-dominated parts of the country is sound.

The Iraqi government said the army and police retook the city’s administrative center without the aid of Iranian-backed Shiite militias – the fighters who were mainly involved in the recent recapture of Tikrit and the Baiji oil refinery. Those troops have been accused of carrying out vengeance killings of Sunnis in the aftermath of battle, and the government was wise to keep them out of Ramadi, the capital of heavily Sunni Anbar province.

The Iraqis were also smart to move gradually against Ramadi. The two months it took to carry out the offensive allowed time for U.S.-led airstrikes to soften Islamic State targets and for many civilians to escape to safety. Unfortunately, it also gave Islamic State forces plenty of time to rig the city with explosives and set up snipers’ nests, and it may now take weeks to clean out the last pockets of resistance.

Iraq’s future depends on building a truly competent military that is representative of the nation’s ethnic and religious mix, and on Prime Minister Haider al-Abadi fulfilling his pledge to protect the nation’s Sunni minority. Otherwise, the next rebellion will always be just around the corner.