Iraqi Prime Minister Haider al-Abadi declared the city of Mosul liberated from Islamic State control on Sunday, a watershed moment in the U.S.-backed Iraqi military campaign against the extremist group. The battle, which stretched nine months, was marked by fierce urban combat, the discovery of Islamic State atrocities and the use of small drones, “Mad Max”-style suicide vehicles and other tactics that prompted U.S. and Iraqi forces to adapt their operations as they fought.

The primarily Sunni city, with an original population of more than 2.5 million, was the biggest prize claimed by the Islamic State in its violent, chaotic sweep across northern and western Iraq in 2014. Islamic State leader Abu Bakr al-Baghdadi declared a caliphate from Mosul’s Great Mosque of al-Nuri, which the Islamic State blew up June 22 as Iraqi forces closed in.

The fight to retake the city in effect turned into two major battles: one for the eastern half of the city and one for the more tightly congested western one, with the two sides separated by the Tigris River.