It has taken many months, and many thousands of lives, but Iraqi forces have finally reclaimed the northern city of Mosul from the ISIS militants who held it for three years.

Mosul, Iraq’s second-largest city, had been ISIS’s biggest prize. After taking the city in June 2014, ISIS leader Abu Bakr al-Baghdadi stood in the pulpit of the city’s 12th-century al-Nuri mosque and delivered a now-infamous sermon declaring the creation of a new ISIS “caliphate.” It was a speech that quite literally put ISIS on the map.

The mosque is gone now, as is ISIS’s control of the city. The militants destroyed the 842-year-old mosque as Iraqi forces closed in on the ancient complex as part of their final push to retake Mosul. It was a symbolic move of a very different sort, one that signals just how far ISIS’s fortunes in Iraq have fallen in a few short years.

The striking photos below are some of the first taken inside the city since it was reclaimed from ISIS.

They were taken by Italian photojournalist Gabriele Micalizzi, who has spent the past nine years covering wars in Afghanistan, Libya, Ukraine, Gaza, and Iraq. He traveled to Mosul in February 2017 to cover the start of the bloody push to reclaim the city and embedded, alongside another Italian journalist, with the Iraqi federal police forces, who played a key role in the fighting.

He returned to the city in early July to document the final phase of the war for the city, embedding with the same forces he’d been with months earlier. At times, Micalizzi was so close to the fighting that he was forced to help treat wounded Iraqi security personnel. At others, he had time to stop and marvel at the scope of the destruction.

“We found ourselves on the rooftops in the middle of ruins, and around us was flying shrapnel and all bullets,” he said via email. “The bodies of the jihadis were everywhere.”

The photos below give you a sense of how much it took to reclaim Mosul — and of just how much work needs to be done before life in the war-ravaged city can begin to return to normal.

—Yochi Dreazen

Warning: Some of the photos below contain graphic content.

Iraqi soldiers fire heavy machine guns and lob grenades from inside a destroyed building in the old city of Mosul.

An ISIS fighter captured near the ruins of the al-Nuri mosque.

A wounded civilian at a makeshift field hospital in the center of the city. Tens of thousands of civilians were trapped in Mosul as the fighting raged; many paid with their lives.

The fierce fighting has left much of the city in complete ruin.

The corpse of a fighter in the ruins near what is left of the al-Nuri mosque. Both sides sometimes had to leave their dead in the streets for hours, days, or longer.

Iraqi forces advance deeper into the old city as part of the final push to retake Mosul.

An Iraqi soldier gazes out over the wreckage of the old city of Mosul as he scans for ISIS snipers targeting the fighters below.