From a ridge overlooking a village in western Mosul, the Iraqi troops spotted the family fleeing the Islamic State. Through their binoculars, the soldiers saw that the small group approaching us was waving a white flag, and so they held their fire.
The family included three women — one of them pregnant — two men, several children and a dog.
The soldiers, with whom I was embedded this week, walked down the trail to intercept the group on the flank of a hill exposed to the Islamic State’s mortar rounds. I saw them help up the grandmother in the family, who was lagging behind.
She reached the top of the ridge, clutching her heart and saying, “Alhamdulillah,” meaning “Thank you, God.”
The grandmother’s name is Khadija Abbas. At the top of the ridge, she crumpled to the ground and held her open palms up to the sky. She took off her tattered plastic shoes and showed me that they were held together with string.
Ms. Abbas explained that at least 10 families related in some way to her were trapped in the village. They had sent her delegation ahead to see if it was safe to leave.
Iraqi intelligence agents were there to meet the family and to try to determine if they were civilians or militants. The officers had a list of people suspected of being members of Islamic State, also known as ISIS or ISIL, and they immediately checked the family’s identification cards against their list.
The Iraqi soldiers in our group, which also included a small unit of American advisers, gave one of the family members a cigarette, as the militants took over the area and forbade smoking nearly three years ago.
The pregnant woman began to feel faint. The New York Times team’s medic ran to the car and came back with an IV drip to help with dehydration. She lay in a ditch as her husband stood above her, holding the bag of fluid.
As members of the family were catching their breath, a ripple of panic suddenly spread through the group: The troops spotted five cars speeding toward us and began firing warning shots.
The pregnant woman, who was still hooked up to the drip, and the grandmother, Ms. Abbas, began screaming that the people coming up the hill were their relatives. The Iraqi Army has suffered numerous casualties from car bombs detonated by Islamic State militants, and the soldiers were visibly on edge.
Ms. Abbas pleaded with the troops, saying their relatives were in three white cars, two silver ones and a blue one. The Iraqi troops, using binoculars for a better view, confirmed her account and stopped firing.
No one was injured. Even the family’s dog — which had scampered away when the gunfire erupted — was safe. “Everyone is fleeing ISIS, even the animals,” one of the villagers joked, when I asked why they had brought the dog with them.
The family showed us the square of cloth they had used as a white flag to signal to the troops that they were civilians. In the barren desert surrounding their village, they said, they had been unable to find a stick to put it on.
By the end of the afternoon, more than 30 civilians had made it to the hill. When the terrorist group began lobbing mortars in their direction, the Iraqi troops asked the families to move.
Hours later, we saw a plume of smoke coming from car bombs in the area that the civilians had fled. By the end of the day, Iraqi forces declared it liberated.
We headed back to our base in a secure part of western Mosul. On the way, we passed one of the cars carrying Ms. Abbas’s family, her relatives flashing “V” signs for victory.