Iraqi forces swept the devastated streets of Ramadi for bombs on Monday, after recapturing the city they lost in May and clinching a major victory against the Islamic State (IS) group.

The Iraqi flag was raised over the government complex at the centre of weeks of fighting late on Monday morning.

"Ramadi has been liberated," Brigadier General Yahya Rasool announced on state television.

Pockets of militants may remain in parts of the city but the army said it has not faced resistance since IS abandoned the flashpoint government complex on Sunday.

Iraqis celebrated in the streets of several cities late on Sunday and officials congratulated the federal forces on their biggest victory since IS overran large parts of the country last year.

"The security forces now control all the streets. There is no resistance from Daesh [an Arabic acronym for IS]," said Ibrahim al-Fahdawi, a security official from Anbar province, of which Ramadi is the capital.

The former government headquarters in Ramadi was the epicentre of the fighting but Iraqi forces did not rush in when IS pulled out because the entire area was rigged.

Explosives and ordinance disposal teams face the extensive task of clearing a city where IS laid thousands of bombs.

"Daesh has planted more than 300 explosive devices on the roads and in the buildings of the government complex," said Brigadier General Majid al-Fatlawi of the army's 8th division.

"They used everything from oxygen bottles to jerrycans, that contain C-4 [plastic explosive] and chlorine," he said.

Several local officials said IS used civilians as human shields to escape the battle when it became clear their last stand in Ramadi was doomed.

IS had an estimated force of around 400 fighters to defend central Ramadi a week ago. It is not clear how many were killed and how many were able to pull back to positions outside the city.

Mosul next?

The Iraqi authorities did not divulge any casualty figures for the federal forces, but medics told AFP that close to 100 wounded government fighters were brought to Baghdad hospitals on Sunday alone.

"The dead bodies are taken directly to the main military hospital" near the airport, said one hospital source, explaining why he could not provide a death toll.

The US-led coalition praised the performance of the Iraqi forces in retaking Ramadi, an operation in which it played a significant role, training local forces, arming them and carrying out what it said were 600 air strikes since July.

The speaker of Iraq's parliament was one of the first top officials to congratulate the security forces on their victory late on Sunday.

"This great victory has broken the back of Daesh and represents a launchpad for the liberation of Nineveh," Salim al-Juburi said in a statement.

Nineveh is home to Iraq's second city of Mosul, from which IS leader Abu Bakr al-Baghdadi proclaimed his "caliphate" straddling Iraq and Syria more than a year-and-a-half ago.

State television showed footage late on Sunday of Iraqis on the streets of Baghdad, Karbala and other cities celebrating the Ramadi victory.

Boost for army

Anbar residents account for more than a third of the 3.2 million people who have been displaced by conflict since the start of 2014.

Many have been living in the northern autonomous region of Kurdistan, and some could be seen celebrating there on Sunday, but Ramadi is devastated and a return to normalcy is some way away.

Iraq's defence minister, Khaled al-Obeidi, said a week ago that Iraqi forces had reconquered more than half of the territory lost to IS in June and August 2014.

The victory in Ramadi comes on the heels of operations that saw Iraqi forces retake Baiji, north of Baghdad, and Sinjar, the hub of the Yazidi minority in the northeast of the country.

The city of Ramadi was recaptured by federal forces, with the Popular Mobilisation - a paramilitary force dominated by Tehran-backed Shia militia groups - remaining on the fringes.

Many of Prime Minister Haider al-Abadi's political rivals had questioned his strategy of excluding those groups and relying on the US-led coalition's air power.

"The prestige goes to the Iraqi military," said political analyst Ihsan al-Shammari.

"As an institution, it's the first time since the Daesh invasion [in June 2014] it has achieved a victory without the support of the Popular Mobilisation force," he said.

The Iraq army collapsed when IS attacked Mosul in June 2014 and swept across Iraq's Sunni Arab heartland virtually unopposed.