The church ceiling was still scorched and some cherished relics missing, but after five years of war and exile, their tormentors were finally gone.

When the men and women of Iraq’s oldest Christian town gathered for Easter mass this weekend, they did so knowing that the Islamic State extremists who had chased them away were not coming back. Their battlefield defeat two months ago meant the people of Hamdaniya (also called Qaraqosh) could once again celebrate without fear.

Maundy Thursday mass at the Church of the Immaculate Conception in Hamdaniya. Photograph: Achilleas Zavallis/The Guardian

A large congregation shuffled into pews that only two years ago lay in splintered ruin, both in the Church of the Immaculate Conception and every other church in Hamdaniya, which, like much of the rest of northern Iraq, had been overrun by extremists from Isis.

A priest in bright red robes holding a gold crosier in one hand and a small cross in the other spoke in Syriac only blocks away from where militants plotted chaos and even genocide for vulnerable communities.

In the darkest years of insurgency, from mid-2014 until late 2016, Hamdaniya and nearby towns had been hotbeds of the Isis presence; bases from which the militant group had planned attacks, assembled bombs and pledged to lay waste to millennia of coexistence. For a while, it seemed that those who had left would never return.

Now, with Isis stripped of its last redoubt of lands, on battlegrounds not far away, and its leadership scattered or killed, Hamdaniya is resurgent, its bustling streets and rebuilt homes a rebuff to fears that the ancient plains of Nineveh could never again be home to a minority who had lived there since the earliest years of civilisation.

Desolate and abandoned in the months after Isis was forced out of town from late 2016, Hamdaniya’s recovery was painstaking. The town’s entire population fled to other parts of Iraq, almost all to the Ainkawa neighbourhood of the Kurdish city of Erbil. There the community was sheltered by Kurdish leaders, who spearheaded the fight against an enemy who had also threatened Kurds, Turkmen, Shias, Shabak and every other minority group who did not bow to its will.

Slowly though, over the past two years, residents have trickled back across the makeshift border into Arab Iraq and what remained of their homes. Local priest Ammar Yaku, 40, said that of Hamdaniya’s pre-Isis population of 80,000, an estimated 25,650 had returned, while about 40% of residents had emigrated, a large number of them to Australia.

“My son is there,” said Yacoub Hanna, a local man standing in a church courtyard. “They are safe, they have schools for the children and they live the life of exiles. Their bodies are there, but their spirits are here.”

Another priest, Younan Hanna, who presided over Easter services at St Jacob’s church, said life away from Hamdaniya had been difficult, but safe, for the community.

“During the time of exile, we had no shortages,” he said. “We were living a good life and we are happy for what [the Kurds did for us]. This is the first Easter we have had back here where we belong, free of the threats. This town doesn’t belong to us, we belong to it. My grandfather knew every stone. Our sons will too. We have been here for a thousand years.”

Despite the new beginning, some scars of the Isis tyranny linger. Across Father Hanna’s shoulder, graffiti on a house said: “The caliphate will remain.” More proclamations from the extremists had been freshly painted over on nearby homes. Another church across town remained in partial ruin, as did several dozen houses that had either been hit by airstrikes or blown up by the extremists before they fled.

“We are protected now by Christian forces,” he said. Of the Iraqi army’s capitulation that led to the fall of Hamdaniya and nearby areas including Mosul, he added: “It was unbelievable. Where in the world has there been an example of an army running away like that, abandoning weapons and uniforms as they ran from the fight?

“But things are better now. We have met senior commanders, and we have regained our trust in them. The town is protected by us and by them.”

In the centre of town, Abu Firas has refurbished a restaurant by day that becomes a club at night. Whisky lines a wall where explosives were stacked from 2014 to 2016. “They turned this into a bomb factory,” he said. “It cost me $18,000 to turn it into this.”

“They’re gone for good now,” he said of Isis. “This is our third year back, but our first year really free. Easter is a celebration. And the people are happy again.”