Iraq's military said on Sunday it was preparing to launch an offensive to retake the Islamic State stronghold of Falluja and told residents to get ready to leave before fighting started.

Families who could not flee should raise white flags to mark their location in the city 50 km west of Baghdad, the military's media unit said in a statement on state television.

Falluja, a long-time bastion of jihadists, was the first city to fall to Islamic State, in January 2014, six months before the group swept through large parts of Iraq and neighbouring Syria.

The Iraqi army, police and Shia Muslim militias, backed by air strikes from a US-led coalition, have surrounded Falluja since late last year. The jihadists have been preventing residents leaving for months.

The army "is asking citizens that are still in Falluja to be prepared to leave the city through secured routes that will be announced later", the statement said, without spelling out when any offensive might start.

Deputy district council chairman Falih al-Essawi said three corridors would be opened for civilians to camps west, southwest and southeast of the city, and a subsequent military statement said some residents had begun to flee.

Residents told Reuters about 20 families had set out from a southern front-line neighbourhood overnight, but only half of them made it out. Some were intercepted by Islamic State, while others were killed by explosives planted along the road by the jihadists.

The UN and Human Rights Watch said last month that residents of Falluja were facing acute shortages of food and medicine amid a siege by government forces. Aid has not reached the city since the Iraqi military recaptured nearby Ramadi, the Anbar provincial capital, in December.

Essawi told a local television channel that more than 75,000 civilians remained in Falluja, in keeping with a recent US military estimate of 60,000 to 90,000. Around 300,000 people lived in the Euphrates river city before the war.

Known as the "City of Minarets and Mother of Mosques", Falluja is a focus for Sunni Muslim faith and identity in Iraq. It was badly damaged in two offensives by US forces against al Qaeda insurgents in 2004.

Saad al-Hadithi, a spokesman for Prime Minister Haider al-Abadi, said the "liberation" of Falluja would help restore normal life to Anbar, the western province over which Islamic State took nearly complete control in 2014.

Following recent government offensives in Rutba and Hit, control of Falluja would secure the road more than 500 km from Baghdad to the Jordanian border and northwards to Haditha, 190 km northwest of the capital.

But Islamic State still controls vast swathes of territory and major cities such as Mosul in the north. Iraqi authorities have pledged to retake Mosul this year, though in private some officials question whether the army will be ready in time.