Footage aired on state television showed a handful of soldiers approach a low-rise building and then emerge on its roof to hoist a small tri-colour banner above their heads.
"Yes, the city of Ramadi has been liberated. The Iraqi counter terrorism forces have raised the Iraqi flag over the government complex," joint operations spokesman Brigadier General Yahya Rasool said in an earlier televised statement.
All of the Sunni terrorist group’s fighters left the government compound in the city center where they had barricaded themselves in. This is considered to be one of the greatest achievements of the Iraqi government since it lost more than a third of its state’s territory to ISIS.
The commander of the Iraqi special counterterrorism forces, Abdul-Ghani al-Asadi, wrapped himself in the Iraqi flag and said in an interview “there remain a very small number of areas in the hands of ISIS but we will liberate them. The liberation of Ramadi is not the end of our mission; there are other struggles ahead.”
"This achievement is dedicated to the Iraqi people, to the families of the victims and the people of al-Anbar. Islamic State’s morale is very low and they are frustrated. They did not dare to deal with us face to face," said one of the counterterrorist unit’s soldiers.
US Army Colonel Steve Warren, a spokesman for a US-led coalition backing Iraqi forces, said in a statement: "The clearance of the government centre is a significant accomplishment and is the result of many months of hard work."
He said the coalition had provided more than 630 airstrikes in the area over the past six months as well as training, advice and equipment to the army, counter-terrorism forces and police.
Authorities gave no immediate death toll from the battle for the city. They have said most residents were evacuated before the assault.
Finance Minister Hoshiyar Zebari said the capture of Ramadi was "a done deal" but said the government had to do more to rebuild the city and encourage displaced people to return.
"The most important thing is to secure it (Ramadi) because ISIS can bounce back," he said in an interview in Baghdad.