Aid organisations are racing against the clock to prepare for what is expected to be a mass exodus of hundreds of thousands of civilians from Mosul as Iraqi forces advance west of Mosul in the final stage of the battle for Mosul to recapture the city from the Islamic State or Iraq and the Levant (ISIL, also known as ISIS).

Emergency camps are being built up in nine cities and tents are being erected in existing camps to absorb internally displaced people. Food and other basic supplies are also being pre-positioned for up to 400,000 Iraqis that aid agencies expect might flee, according to aid groups.

"The greatest concern is the fact that we might have a massive surge of civilians being displaced," said Hala Jaber, a spokesperson for the International Organization for Migration (IOM).

"We are preparing to expand the camps and build up emergency sites to be able to take the numbers."

Aid agencies operating on the ground in Iraq say there are three possible scenarios: A protracted siege of the old city, mass displacement of up to 400,000 or the "best case scenario", an orderly evacuation of Iraqis as parts of western Mosul become secure.

There are already plots available to shelter at least 60,000 people in sites east and south of Mosul, according to the UNHCR, but in addition to this, other utilities, including latrines, showers and roads as well as security personnel, should be made available, a process that usually takes up to six weeks.

Hundreds of thousands of civilians might be trapped - maybe for weeks, maybe for months. Lise Grande, UN humanitarian coordinator

Since the offensive was launched on October 17, 2016, more than 217,000 people have been displaced from eastern Mosul, which was retaken by Iraqi forces last month, lower than the initial projections of aid agencies. Already 57,000 people have returned to their neighbourhoods.

However, the battle for western Mosul, where 800,000 people live, is expected to be more challenging than the east because armoured vehicles cannot pass through the compact area's narrow alleyways, Iraqi commanders have said.

Around 400,000 people live in the dense quarters of the old city, which contains ancient souks and the Grand Mosque.

"In the old city, the narrow alleyways may require a different fighting modality so the level of risk could reach unmanageable proportions," Bruno Geddo, UNCHR's representative in Iraq, told Al Jazeera. "That is why we want to make sure we are prepared for a possible large-scale outflow."

There are places reserved for 250,000 civilians, Geddo added, but timing is another concern. "If they are displaced in a matter of two days, this could become overwhelming. We need enough capacity for a mass outflow."

Humanitarian workers are also bracing for a possible siege of the old city, but the unpredictable nature of the fighting is also complicating planning for them.

"We don't know what will happen during the military campaign but we have to be ready for all scenarios," Lise Grande, the United Nations' humanitarian coordinator, said in a statement. "Hundreds of thousands of civilians might be trapped - maybe for weeks, maybe for months."

Supplies are already dwindling for Mosul residents trapped in the west, after the main road to Syria was cut off three months ago. Half the food shops have been shuttered, and prices of fuel to heat homes and cook food have skyrocketed. Families reported burning furniture and rubbish to keep warm. Food prices in western Mosul are almost double those in the east.

About 60 percent of Mosul residents also lack potable drinking water, according to UN figures. Many depend on untreated water from wells, after treatment plants suffered damage from the fighting.

The desperate conditions of west Mosul residents are expected to be compounded as Iraqi forces close in and surround the old city in an effort to root out ISIL fighters.

"There are possibilities which in fact may be sequential. What we expect for now is a siege-like situation in which forces surround the city, they go in and extract people from neighbourhoods," said Geddo. "But there could also be a possibility that ISIS will use civilians as human shields, in which case we would have a pro-longed situation.

"In that case we need to get supplies to people inside so they can survive." Aid workers admitted there is little that can be done without a humanitarian corridor in the event of a siege, and even then civilians would have to risk their lives and transgress ISIL orders to stay put. Geddo said aid agencies are working out a means to provide cross-line support.

Civilians are also being smuggled out of western Mosul, some paying as much as $2,000 to escape and meet their family members in the east.

Another aid worker, who spoke on condition of anonymity, hinted the possibility of scattering aid from low-flying airplanes, but added there was no guarantee of success.

With a protracted siege, funding too might become an issue, Geddo warned. "If the Mosul operation is prolonged, we will find ourselves in need of additional funds."