Some pushed wheelbarrows piled high with their belongings across the only bridge to Baghdad. Others balanced battered suitcases on their heads, or held babies aloft so they would not be crushed in the exodus from Iraq's western province of Anbar.
More than 90,000 people have fled their homes in Anbar since April 8, when the Islamic State of Iraq and Syria (ISIS) militants began gaining ground around the provincial capital Ramadi, about 90 km (55 miles) from Baghdad, the United Nations said on Sunday.
The latest migration compounds an intensifying humanitarian crisis in Iraq, where 2.7 million people have been displaced within the country since January 2014.
Aid agencies expect hundreds of thousands more to be uprooted if Iraqi forces move to take on the insurgents in their remaining strongholds of Anbar and Nineveh in the north.
Mosques in the capital have opened their doors to shelter hundreds of families arriving from the Sunni heartland, although some are stuck outside Baghdad at the Bzaibiz bridge checkpoint.
A weary-looking Ahmed Abdulrahman, who had just crossed the bridge, said he left his home in Sofiya, east of Ramadi, several days ago, due to power cuts and food and water shortages rather than fighting.
"Everything ran out except air," said the 56-year old government employee, dragging a suitcase and with dust on his face. "Even the sounds of life around us stopped. The situation became unbearable."
The insurgents said whoever wished to leave was free to do so, and showed Abdulrahman and his family a safe way out of Sofiya. Entering Baghdad proved harder, because authorities require some migrants to provide a guarantor inside the capital to prevent infiltration by militants.
"When we reached Bzaibiz bridge we found that the government had obstructed our advance in Iraq, and is discriminating between this person and that," al-Rahman said.
More than half a million people from Anbar were displaced even before ISIS overran the northern city of Mosul last summer and took control of roughly a third of Iraq. Since then, the figure has almost doubled.
Anbaris account for at least 30 percent of those displaced within the country since the beginning of last year -- the second highest level for any single governorate, according to data from the International Organization for Migration.
"Our neighbors came and told us they were leaving because the situation was bad and ISIS might enter at any moment," said 37-year old Umm Sabah, who hurriedly stuffed some clothing into a bag, snatched up her identity papers and joined them.
"It's as though it is my destiny to move from place to place in my country and not possess a plot of land or home of my own".
"Liberation" or "occupation"?
Iraq's Prime Minister Haider al-Abadi announced two weeks ago that Anbar would be the next battleground after ISIS militants were routed in the city of Tikrit to the north.
But the new campaign to reclaim the vast desert terrain had hardly got underway when the militants attacked Ramadi and took control of areas to the north and east, leading local officials to warn the city was about to fall.
Reinforcements reached Ramadi over the weekend and the militants' advance appeared to stop. The crowds of people leaving thinned on Monday, and a few families were already returning to some areas, even though the militants are still in control of the city's periphery.
"All the provincial officials have fled to Baghdad and elsewhere, so why should we stay?" said engineer Mohammed al-Fahdawi, who left the Sijariya area east of Ramadi on Saturday.
The majority of those recently displaced have headed to Baghdad, with smaller numbers moving within Anbar, most of which is under ISIS control. A minority have gone south to Kerbala and Babel, or north to the Kurdistan region.
Fahdawi was skeptical Anbar could be liberated by the army alone, and said he welcomed any force that would fight ISIS, including Shi'ite paramilitary groups that have played a leading role in reversing the insurgents' advances elsewhere.
But 42 year-old teacher Saad Jaber Karim said that if what he had heard about Shi'ite militia abuses against Sunnis in areas retaken from ISIS was true, he would rather the insurgents stayed in control.
Abdulrahman said it would make little difference to the people of Ramadi which force took control.
"Liberation and occupation are two sides of the same coin," he said.SHOW MORE