The jihadists seized a third of Iraq, ruling their self-declared "caliphate" with an iron fist, before an international coalition wrestled control from them in 2017.
Iraq -- marred by decades of war and turmoil even before the rise of IS -- is home to more than a million internally displaced people. Baghdad has been pushing for the closure of the displacement camps, with the country having attained a degree of comparative stability in recent years.
Most of the camps in federal Iraq have now been closed, but around 20 remain in the northern autonomous Kurdistan region, which according to the United Nations house more than 115,000 displaced people. But for many, actually returning home can be a difficult task.
In an effort to close the camps and facilitate returns, Iraqi authorities are offering families around $3,000 to go back to their places of origin. To do so, displaced people must also get security clearance -- to ensure they are not wanted for jihadist crimes -- and have their identity papers or property rights in order.
But of the 11,000 displaced people still living in six displacement camps near Hassan Shami, 600 are former prisoners, according to the UN. They were released after serving up to five years for crimes related to membership of IS.
For them, going home can mean further complications. There's the risk of ostracism by neighbours or tribes for their perceived affiliation with IS atrocities, potential arrest at a checkpoint by federal forces or even a second trial.
Imrul Islam of the Norwegian Refugee Council said displacement camps by definition are supposed to be temporary, but warned against their hasty closure. When people return, "you need schools. You need hospitals. You need roads. And you need working markets that provide opportunities for livelihoods," he said. Without these, he said, many families who try to resettle in their home towns would end up returning to the camps.