The number of displaced people who have returned to their homes has exceeded the number of people forced to leave Iraq for the first time since militants took over large areas of the country in 2014, the International Organization for Migration (IOM) said Thursday.

The source said that at the end of December 2017, 3.22 million people had returned to their homes, while 2.61 million were still displaced.

The development came at the end of the month, when Iraqi authorities declared their military victory against Islamic state militants expelled from all city centers.

“By the end of 2015, less than half a million people have returned to their homes,” said Sandra Black, a spokeswoman for the organization in Iraq. “In 2017, 1.85 million people returned.”

“The restoration of large areas of Iraqi forces was important and security improved,” she said.

In 2014, the radical Islamic organization occupied one-third of Iraq’s territory and threatened the existence of the state, before the counter-attack by Iraqi forces.

About one-third of the displaced are in the northern province of Nineveh and the largest cities in Mosul, Iraq’s second city, and saw a nine-month street war that ended with the liberation of extremists.

Among the displaced returnees, more than a million have returned to the mainly Sunni province of Anbar, where the last battle took place to restore the last townships of extremist militants.

Among the returnees, “about a third said they found their homes completely destroyed or to a large extent, and 60 percent found them moderately damaged,” said Sandra Black.

Infrastructure has also been hit by violence, and some neighborhoods have so far lacked electricity and drinking water.