Transcript for On the front lines with Iraqi forces fighting ISIS in Mosul
And tonight you're going to get an extraordinary up-close lk at what it's like to be inside a major city that is being liberated from ISIS. We're on the front lines in mosul, Iraq, where snipers and suicide bombers are fighting until the end and where families have lived through hell. You're going to meet children who survived being used as human shields. "Nightline" welcomes ABC's Ian Pannell reporting from mosul. Reporter: A lone flag. Planted in a wasteland. A milestone in the fight against ISIS many thought would never come. Iraqi forces retaking the city of mosul. But it comes at a heavy price. It's impossible to describe the scale of the destruction here. It's 360 degrees. I've rarely seen anything quite this devastating. It barely looks like a city anymore. When we arrived just last week, the u.s.-backed offensive to retake the city was in its final days as Iraqi troops gained ground we saw hundreds of families fleeing. They emerged as if from hell. [ Speaking foreign language ]. Reporter: It's incredible. There are a dozen, two dozen people have just gone by, men, women, old men, children, some of them clearly very badly injured. [ Speaking foreign language ]. Reporter: There's nothing here. There are no facilities. There's no hospital. There's no care. The survivors shell-shocked and shattered. [ Speaking foreign language ]. Reporter: The escape to safety is perilous. Huge piles of db rie are haebris are hard to navigate and slow to climb. After years of brutal occupation those who are physically able struggle out, often helping the old and infirm. Some are separated from their families, sometimes forced to leave them behind, like Marian. This was the country's second largest city and it's been the beating black heart of the islamic state in Iraq since it swept through here three years ago. Last time I was here was with counterterrorism forces and they were the first troops to push into the city. So we were at the tip of the spear. At that point this was insanely dangerous. I was there on day one of the offensive. We've seen a number of ISIS fighters moving around, carrying rocket-propelled grenades. There have been incoming attacks. And a lot of gunfire. Reporter: The fighting lasted nearly nine months. Thousands killed, tens of thousands injured. Despite a declaration of victory, the battle for the city isn't entirely over. Something we witnessed as we made our way through the bombed-out buildings and alleyways of the old city. With special forces general sadi. What would you say the biggest dangers are? Pockets of ISIS fighters remain, huchker hunkered down, ready to fight to the death. I'm going to count to three. Reporter: It's the unprotected spaces between the buildings that are most dangerous. Where ISIS snipers perch overhead, picking off their victims. Sniper, sniper. Okay, the troops are telling us to take cover in here. We're very close to the front line, and they're literally fighting over every inch, every yard. The fighting is really intense in this area, even now when they say they're almost finished. Reporter: Within minutes of us filming these two soldiers in the alley a suicide bomber leapt off a building, attacking them. Both were wounded. For the men of the counterterrorism force this is a kill mission, a hunt for the final ISIS fighters. They rarely take prisoners. There are two bodies lying in the streets here, clearly belonging to ISIS fighters. And as the troops cover the ground, help comes from the air. Air strike. Another air strike. American? Yeah, American. Americans. We've been hearing the sound of that consistently throughout this morning. Constant strikes by the u.s.-led coalition. It's hard to imagine that the troops would have got this far forward despite the brave fighting on the ground without that support. Reporter: We move to the very front. A house just taken from ISIS and a symbol of the crumbling caliphate. In a deliberate show of scorn they turn the flag upside down and smile for the camera. And amidst the chaos and rubble children's clothing. A reminder of the lives once lived here. I don't know if you can see this here. Residential areas. These are houses destroyed. These are lives destroyed here. And this is because of what ISIS did. Soldiers and civilians have paid a terrible price. For a war they didn't choose. 6-year-old Malak and her 15-year-old sister Dalal were forced to help those who were terrorizing them. They were used as human shields. ISIS fighters made them run into the line of fire of the advancing Iraqi army. Their father was killed. Bo girls horrifically injured. You can see where the little girl was shot. She's obviously had surgery here. And she's got bullet wounds as well. She's also got wounds here. You can see three clear distinct scars there. It looks like the bullets perhaps went through her. It's an absolute miracle that Malak is alive. And her name in English means angel. She's a really strong little girl. You're super strong. Yeah. You are strong. Reporter: Her sister Dalal lost her hand in an explosion. This is your house? Reporter: ISIS even used their home as a hideout. The thing I want to show you here are the holes in the walls on the left and the right-hand sides. Easily enough space for a man. And these holes were made by the family for ISIS. I want to bring in our translator here, shed. Ashed, can you ask the ladies why they did this? Why were these holes made? [ Speaking foreign language ]. She said they make us do this so they can use it as a cover from the air strikes to go in and out from another house to another house. So like a rat run essentially so they can move there and they're completely unseen. Yeah. What would have happened if you hadn't made those holes that they drew on the wall? They will blow up the house. They'll blow up the house if they didn't do this. Or they'll kill the people inside. And we've heard this story repeatedly from people, that they were ordered to do things by ISIS, and these stories are repeated time and time again throughout this whole neighborhood, throughout this whole city. For the families that have reached safety their struggles aren't over. Nearly a million people are displaced. Ahmed stands at his brother's bedside. He's waiting for word from his wife. They were separated as they escaped. So he's asking family members if they have news. Gaith gets word his wife may be coming. Eventually she appears, injured but safe and alive. And just feet away we met Samir, standing watch over his baby girl, Rama, one of the youngest victims of ISIS. Poor little thing. She's dehydrated. She's malnourished. I've been told that the mothers can't breast-feed because they don't have enough food. There's been no clean water. We were able to ask ISIS to let you out with the baby to get food? After months living as prisoners in their own homes, denied the basics for survival by extremists who claim to be men of god, many are overcome by the agony of what they've endured. Malak and Dalal are trying to reclaim pieces of the life they once had. Do you feel angry about what's happened? Sad? But these girls refuse to be held hostage ever again. Dalal wants to become a teacher, to use education as a weapon against ISIS. Her little sister just trying to enjoy life, as only a 6-year-old can. Too many children bear the wounds of war. Physical and mental scars, symbols of their survival. And miraculously, despite an uncertain future, their hopes and dreams are still alive. For "Nightline" Ian Pannell in mosul, Iraq.
This transcript has been automatically generated and may not be 100% accurate.