An Iraqi child holds a white flag as he flees with his family from Mosul on Nov. 3. (Ahmed Jadallah/Reuters)

Holding white flags and traveling in convoys of dump trucks, army buses and family sedans, thousands of residents poured out of eastern neighborhoods of Mosul on Thursday, the first significant wave of people to escape the city held by the Islamic State.

More than 1.2 million people are believed to still be trapped in the northern city, which Iraqi security forces are just beginning to penetrate after launching an offensive to retake it two weeks ago. Newly constructed camps in the area have the capacity for just 60,000 people.

The stream of humanity, which included shepherds pushing herds of sheep out of the war zone, crawled along in heavy traffic leaving Mosul and headed toward a swelling camp for displaced people erected on the banks of the Khazir River. The camp has space for 1,000 families but was rapidly filling up.

Even as they fled, some were almost giddy with relief. Drivers in the convoys blasted their horns and waved V for victory as Iraqi and Kurdish troops passed by on their way to the front lines.

Girls and young women who were forced to wear black veils over their faces in Mosul took them off and let the wind blow though their hair.

Displaced people gather as they for food distribution at a camp in Qayyarah, south of Mosul, on Nov. 3. (Felipe Dana/AP)

[Trapped in a house with Islamic State fighters]

For nearly 21/2 years, they have lived under Islamic State rule in the group’s de facto capital in Iraq. It was in the city’s central mosque that the group’s leader, Abu Bakr al-Baghdadi, declared his caliphate two years ago, calling on the world’s Muslims to follow him.

Now Iraqi commanders say it’s just a matter of time before the city is recaptured, though no one is sure of the cost that civilians trapped inside may pay. As government troops closed in, Baghdadi rallied his followers on Thursday, releasing an audio recording that called on them to remain steadfast and fight and to obey their commanders.

“Oh you who seek martyrdom! Start your actions!” Baghdadi said in a translation provided by the SITE Intelligence Group. “Totally decimate their territories, and make their blood flow like rivers.”

Analysts said it was the first time that the Islamic State leader, whose whereabouts are unknown, had personally called on his fighters to maintain discipline on the battlefield, suggesting he may be concerned about defections.

Some Iraqi commanders have said that Islamic State fighters and their families have moved from the eastern side of Mosul to the west or even to Syria, although such reports are difficult to verify.

The number of civilians fleeing increased “significantly” Thursday as fighting crossed from villages to more densely populated neighborhoods on the outskirts of the city, said Alvhild Stromme of the Norwegian Refugee Council. She said that at least 1,000 families had fled, but new arrivals were still being counted.

1 of 48 Full Screen Autoplay Close Skip Ad × The battle for Mosul View Photos Iraqi forces launch their most ambitious fight against the Islamic State. Caption Iraqi forces continue their most ambitious fight against the Islamic State. Iraqi Federal police celebrate in West Mosul. Alaa Al-Marjani/Reuters Buy Photo Wait 1 second to continue.

[Iraqi Christians, scarred by Islamic State, doubt they’ll return to Mosul]

Sabah Noori, a spokesman for Iraq’s special forces, said that about 5,000 people had fled the eastern neighborhood of Gogjali, which the forces entered on Tuesday, and that a similar number had stayed behind. The Iraqi army also said it had stormed the Mosul neighborhood of Intisar on Thursday, pressing farther into the city.

“We were dead to the world, but God did not want us yet,” said Saad Fahad, 46, who fled from Gogjali.

Asked what the past few days had been like, Fahad said, “It was a horror, to be honest.”

He and relatives hid under a stairwell and in a bathroom, he said.

Fahad came out with 40 members of his extended family in four vehicles, their rooftops piled with chairs, bicycles and mattresses and their pickup truck beds loaded with children.

They were down to bread and tea before they ran. Shops in the neighborhood ran out of food two or three days ago and then shuttered during the fighting, he said.

One of his cousins was freshly shaved and said it was a relief to be free of the long beard that the Islamic State demanded of men.

But Fahad said: “It wasn’t the beards or the forbidden mobile phones or cigarettes that was the worst. It was the psychological pressure. You refuse anything? They called you an infidel and could take you away.”

Ahmed Mohammad, 33, a laborer traveling with 23 family members, said that after one of the first Iraqi troops entered his neighborhood on Tuesday night, “I ran out of the house and kissed his boots.”

Ahmed, who asked that his last name not be used because he still had relatives in Mosul, said that the eastern edge of the city was first shelled by Iraqi forces and later by the Islamic State.

“Many civilians are dying,” he said.

“If you have a car, you will leave. If you don’t, you will try to walk,” Ahmed said, predicting that Mosul would empty itself out, at least in districts with heavy fighting. “Only the shepherds will stay, to protect their animals.”

Iraq’s armed forces are trying as much as possible to keep families in their homes as they advance, hoping to divert a humanitarian crisis that the country is woefully ill-equipped to deal with. Some 3.4 million people have already been displaced during Iraq’s war against the Islamic State. But as conflict nears their doors, many people inevitably choose to flee.

Iraqi forces are searching houses for Islamic State fighters trying to mingle with the civilians.

A young man named Dhiab, who declined to give his last name, rode out of Mosul in the back of a dump truck said it would be hard to persuade residents to stay, because the populace is traumatized.

Just before the fighting began, he said, Islamic State gunmen intensified their search for spies and members of a popular resistance groups. The Islamic State fighters would demand identification and then check names against lists they kept on laptops.

“A mobile phone was a death sentence,” Dhiab said. “If you were former police, army? The same.”

Mustafa Akram, a political officer in the Kurdish peshmerga forces, stood at the gates of the Zharir camp, where a long line of people from Mosul had formed.

“First they will be searched, then vetted. Then they will be given some food and blankets,” Akram said.

It was possible that active supporters of the Islamic State — and even some Islamic State fighters — could appear at the camp and slip through the fast screening process being run by peshmerga intelligence units. But eventually they would be found out, Akram said.

Morris reported from Irbil, Iraq. Aaso Ameen Shwan and Mustafa Salim contributed to this report.

Read more:

Militants are kidnapping thousands of people to use as human shields

A look inside ‘Q-West,’ where U.S. troops are supporting Iraq’s fight for Mosul

Today’s coverage from Post correspondents around the world

Like Washington Post World on Facebook and stay updated on foreign news