ISTANBUL — Another city in Iraq has slipped the grasp of the Islamic State, the extremist group that three years ago controlled a vast caliphate straddling Iraq and Syria that threatened to rewrite Middle Eastern borders drawn after World War I.

Now the group is on its back foot with its latest loss, the northern Iraqi city of Tal Afar, which Prime Minister Haider al-Abadi of Iraq declared liberated on Thursday.

The relatively quick victory in Tal Afar, after an 11-day battle by Iraqi forces backed by American air power, comes on the heels of the grueling and bloody nine-month fight for Mosul, the largest Iraqi city the Islamic State, also known as ISIS, ever controlled.

The mounting losses sustained by the group suggest that its days of administering territory are waning. Iraqi forces continue to push west, toward the Syrian border, while in Syria, American-backed Kurdish and Arab fighters press their assault on Raqqa, the Islamic State’s de facto capital.