Thousands of displaced people fleeing from Ramadi and the violence in Iraq's western Anbar province have poured into Baghdad after the central government waived restrictions and granted them conditional entry.

The exodus is the latest in the aftermath of the fall of the city of Ramadi - the capital of Anbar, Iraq's largest Sunni province - to Islamic State over the weekend.

The Shia-led government in Baghdad is struggling to come up with a plan to reverse the stunning loss of the city, pledging a counter-offensive and relying on Iranian-backed Shia militiamen to join the offensive.

Athal al-Fahdawi, an Anbar councilman, said thousands of civilians from Ramadi who were stranded on open land for days are now being allowed to cross a bridge spanning the Euphrates River and enter Baghdad province.

Five of the displaced residents died from exhaustion in the Bzebiz area, where the displaced had been forced to stay as they were kept away from Baghdad.

According to the International Organisation for Migration, more than 40,000 people have been displaced from Anbar province since Friday, when IS conquered Ramadi.

In the past, people fleeing Anbar have been prevented from entering Baghdad due to fears that militants might mingle in with the crowds and sneak into the Iraqi capital.

Meanwhile, residents still left in Ramadi said that IS militants were urging them over loudspeakers not to be afraid and to stay in the city, already suffering from acute shortages of food and medicines.

However, IS fighters were not preventing those wanting to leave the city to go, the residents said.

It is still unknown when the expected wide-scale operation to recapture Ramadi and other cities will start.

Baghdad officials and leaders of the so-called popular mobilisation units, which consist of a number of Shia militias who are fighting on the side of the Iraqi military and security forces, have repeatedly said they need time for a military build-up and reconnaissance.