This article includes graphic images some readers may find disturbing.

This week, three years after Islamic State militants seized Mosul, Iraqi Prime Minister Haider al-Abadi entered the city to announce its liberation, declaring victory in the nine-month siege even as fighting continued in the last pockets of ISIS-controlled territory.

I announce from here the end and the failure and the collapse of the terrorist state of falsehood and terrorism,” al-Abadi said in a speech on Monday.

But the cost of rolling back ISIS in Iraq has been staggering. Swaths of major cities like Mosul and Fallujah lie in ruins. Tens of thousands of Iraqis have been killed and wounded, and minority groups, such as Yazidis and Christians, have faced outright genocide. Although Mosul has returned to the control of the central government, cities like Tal Afar and Hawija remain under ISIS. Meanwhile, hundreds of thousands of Iraqis are stranded in refugee camps around the country, awaiting an uncertain future.

A man hands his younger brother, killed by an IED, to a medic at a field clinic in the Samah neighborhood of Mosul, Iraq on Nov. 18, 2016.

A man hands his younger brother, killed by an IED, to a medic at a field clinic in the Samah neighborhood of Mosul, Iraq, on Nov. 18, 2016.

Cengiz Yar, an American photojournalist based in Iraq, has compiled a visual record of this harrowing period of Iraqi history, covering the military operations to retake Mosul, the impact of the war on civilians, and the resilience of Iraqis despite years of bloodshed and totalitarian rule. “I’ve watched people run across sniper alleys [toward government-controlled areas] to escape from ISIS,” Yar said. “When they made it across, they’d be greeted by the soldiers and would hug and kiss them. Thanking them for coming to save them.

Ordinary Iraqis today feel “everything from elation to despair,” Yar said. “Many people are simply happy to be freed of ISIS, while others who have lost their homes or lost their families are asking, what is left for their lives after this?”

A woman gives her young child water while waiting to be let into the Hasansham camp for displaced persons on Nov. 4, 2016.

A woman gives her young child water while waiting to be let into the Hasansham camp for displaced persons on Nov. 4, 2016.

The coalition fighting ISIS is made up largely of Iraqi Special Forces, the Iraqi Army, the Federal Police, and the Emergency Response Unit, with the United States and other coalition partners providing air support. Thousands of people have been killed or wounded in what U.S. commanders have described as “the deadliest urban combat since World War II.”

“Iraqi forces have paid a heavy price — every guy I’ve talked to has lost either friends or family members, and many of them have been injured in combat three or four times,” said Yar. “Over so much time fighting, many of these guys have been wounded, patched up, and went back into the fighting as soon as they could.”

The war with ISIS is the latest chapter in a series of conflicts that has torn apart Iraqi society, from the Iran-Iraq War in the 1980s to the Gulf War to the U.S. invasion in 2003. The almost unbroken fighting has caused deep pessimism.

“Iraqi soldiers I’ve spoken with have told me that they believe this conflict is never going to end and that Iraq is never going to be stable,” Yar said. “After ISIS is defeated, many people believe there will be something like an ‘ISIS 2.’ There will always be something.”

Dispelling these fatalistic sentiments will be a task for Iraq’s leaders and the international community. If they don’t provide security and a sense of hope for the many Iraqis who have lost their homes, families, and livelihoods, a new round of civil conflict feels inevitable.

“A lot of people in refugee camps just have no idea when they will be able go home, and they don’t trust that there’ll be security for their families if they do,” said Yar. “Much of the reason that this war happened in the first place was lack of trust in the government, and the ability of [ISIS] cells to exploit that situation using gang-like tactics to force control over territory.”

“It’s possible that something like this could happen again in the future,” he added, “if this isn’t handled right.”

combo-cengiz-yar-iraq-1499788405

Left: A woman cries over the body of her husband at a clinic south of Mosul, Iraq on Feb. 23, 2017. Right: Smoke rises from fighting in west Mosul, Iraq on April 11, 2017.

A young boy, wounded by shrapnel in his face and groin, is treated at a clinic in the Samah neighborhood of Mosul, Iraq on Dec. 1, 2016. He continued to drip blood through the gauze and bandages the medics wrapped him in before loading him into an ambulance.

A young boy, wounded by shrapnel in his face and groin, is treated at a clinic in the Samah neighborhood of Mosul, Iraq, on Dec. 1, 2016. He continued to bleed through the gauze and bandages before medics loaded him into an ambulance.

combo-cengiz-yar-iraq-2-1499788661

Left: Civilians line up near the Al Karama Al Khadhra Apartments in eastern Mosul for a food distribution by a local NGO. This location was said to be only 300 meter from the frontline and far too close for international aid organizations to reach. The food ran out quickly. Right: A young boy eats candy as he waits for his family to be allowed past the military checkpoint in Qayyarah, Iraq on Oct. 26, 2016.

Newly displaced civilians from Hawija wait outside an interrogation room in a base run by Asayish, Kurdish Regional Government security forces, in Dibis, Iraq on Dec. 12, 2016.

Newly displaced civilians from Hawija wait outside an interrogation room in a base run by Asayish, Kurdish Regional Government security forces, in Dibis, Iraq, on Dec. 12, 2016.

People fleeing fighting between Iraqi forces and ISIS line up to board a truck headed for an displaced persons camp southwest of Mosul, Iraq on March 1, 2017.

People fleeing fighting between Iraqi forces and ISIS line up to board a truck headed for a displaced persons camp southwest of Mosul, Iraq, on March 1, 2017.

An officer with the Iraqi National Security Service (NSS) subdues civilians during a raid on suspected ISIS militants in eastern Mosul, Iraq on Feb. 21, 2017. The teenager facing away from the camera was arrested on suspected ISIS ties; the man on the right facing the camera was not arrested but was forced to the ground so he would not interfere.

An officer with the Iraqi National Security Service subdues civilians during a raid on suspected ISIS militants in eastern Mosul, Iraq, on Feb. 21, 2017. The teenager facing away from the camera was arrested on suspected ISIS ties; the man on the right facing the camera was not arrested but was forced to the ground so he would not interfere.

combo-cengiz-yar-iraq-3-1499788811

Left: Medics carry Mohammed, 12, to an ambulance at a field clinic in the Samah neighborhood of Mosul, Iraq on Nov. 13, 2016. Mohammed was seriously injured during a mortar attack that killed his 15-year-old neighbor Matham Tarek. They were both displaced civilians fleeing the conflict in Mosul. Right: The stretcher used to treat Mohammed at a field clinic in the Samah neighborhood of Mosul, Iraq on Nov. 13, 2016.

Newly displaced civilians fleeing the conflict between the Iraqi army and ISIS arrive at a mustering area on the northern edge of Gogjali in Mosul, Iraq on Nov. 4, 2016.

Newly displaced civilians fleeing the conflict between the Iraqi army and ISIS arrive at a mustering area on the northern edge of Gogjali in Mosul, Iraq, on Nov. 4, 2016.

An injured civilian lies on a stretcher at a clinic south of Mosul, Iraq on Feb. 23, 2017.

An injured civilian lies on a stretcher at a clinic south of Mosul, Iraq, on Feb. 23, 2017.

Burning oil pits in Qayyarah, Iraq on Oct. 26, 2016.

Burning oil pits in Qayyarah, Iraq, on Oct. 26, 2016.

A dead child lies in a body bag at a clinic south of Mosul, Iraq on Feb. 23, 2017.

A dead child lies in a body bag at a clinic south of Mosul, Iraq, on Feb. 23, 2017.

Matham Tarek's father cries near his son's body at a field clinic in the Samah neighborhood of Mosul, Iraq on Nov. 13, 2016. He was killed by a mortar attack.

Matham Tarek’s father cries near his son’s body at a field clinic in the Samah neighborhood of Mosul, Iraq on Nov. 13, 2016. He was killed by a mortar attack.