Iraq Prime Minister Haider al-Abadi has declared that the country has fully liberated itself from the Islamic State (ISIS).

The defeat of ISIS comes after three years of battles since the terrorist group leaked into Iraq and captured Mosul, the country’s second largest city, and other key cities along the border of Syria.

During the last three years, ISIS controlled around 34,000 square miles of land in Iraq that extended from the Mediterranean coast to Baghdad. From The New York Times:

The Iraqi senior military commander in charge of operations against the Islamic State confirmed that his forces, supported by the American-led coalition, had regained control of the border areas. Military leaders have said they were the last part of the country where ISIS’ supporters could muster any organized resistance.

The prime minister’s announcement heralded a significant turnaround for the nation’s armed forces and political leadership from the summer of 2014, when the military, hollowed out by years of corruption and inept political decisions, crumbled under the juggernaut of the Islamic State’s once-formidable fighting force.

The joy of defeating ISIS has spread through Iraqi communities with people finding “newfound pride in their security forces, as well as in their government.”

But the fight to remain secure from the terrorist group remains. Security experts warned that ISIS remains a threat. Hakim al-Zamili, the leader of the security and defense committee, said he believes that 20,000 ISIS supporters are still in Iraq and disguising themselves among those displaced.

Last month, the Iraqi forces retook Rawah, which is the last city in the country that ISIS held. The forces then went into the deserts around the city to clear out remaining terrorists.

Mosul, a city once rich in Islamic and Christian history, came back under Iraqi control earlier this year. The battle for the city did not end until July and the terrorists kept up the fight for the city after that, too.

The government must take steps “to ensure security and stability” as officials reconstruct cities like Mosul and implement “reconciliation programs for the country’s Sunni and Shiite communities.”

Over three million people are still displaced due to the war. It will take awhile for them to return home as many “municipal services have yet to be restored in liberated areas.”

Due to the remaining threat, al-Zamili has encouraged the international community to stick with them to track down the remaining terrorists:

“Iraq still needs the intelligence cooperation with the international coalition and neighboring countries because there are many places for ISIS to hide,” said Wathiq al-Hashimi, the chairman of the Iraqi Group for Strategic Studies, an independent think tank in Baghdad. “ISIS commanders are now in different countries in the world.”