In dramatic footage provided by volunteer aid group Free Burma Rangers, Dave Eubank is seen rescuing a young child from ISIS gunshots in Mosul, Iraq. The rescue was part of a rescue effort following a mass attack by ISIS on June 2, 2017. (Published Thursday, June 22, 2017)

Prime Minister Haider al-Abadi congratulated Iraqi troops Sunday in the streets of Mosul for driving Islamic State militants out of most of the city. But airstrikes and sniper fire continued amid the revelry, and the extremists stubbornly held small patches of ground west of the Tigris River.

Over the nearly nine-month campaign, Iraqi forces — backed by airstrikes from the U.S.-led coalition — reduced the IS hold on Iraq's second-largest city to less than a square kilometer (less than a mile) of territory.

Still, al-Abadi and Iraqi commanders stopped short Sunday of declaring an outright victory against the extremists, who have occupied Mosul for three years. Losing Mosul would be a major defeat for the Islamic State, which has suffered major setbacks in the past year.

"We are glad to see normal life return for the citizens," al-Abadi said, according to a statement from his office. "This is the result of the sacrifices of the (country's) heroic fighters."

Dressed in a black military uniform, the prime minister met field commanders, kissed babies and toured a reopened market in western Mosul. At one point, he briefly draped an Iraqi flag on his shoulders.

A few kilometers away, special forces commanders climbed over mounds of rubble on the edge of Mosul's Old City to plant an Iraqi flag on the western bank of the Tigris, marking weeks of hard-fought gains in the heart of the congested district.

Suddenly, two shots from an IS sniper rang out, sending the men scrambling for cover. The flag was retrieved and planted farther upriver behind a wall that protected it from a cluster of IS-held buildings nearby.

"We've been fighting this terrorist group for 3 1/2 years now," said Lt. Gen. Abdul Wahab al-Saadi of the special forces. "Now we are in Mosul, the east part was liberated, and there's only a small part left in the west."

Al-Saadi emphasized that despite the flag-raising, the operation to clear Mosul of the militants was ongoing. Behind him, a group of soldiers and local journalists recording the scene sang a traditional Iraqi victory ballad.

Lt. Gen. Jassim Nizal of the army's 9th Division said his forces achieved "victory" in their sector, after a similar announcement a day earlier by the militarized Federal Police.

Soldiers danced atop tanks to patriotic music even as airstrikes sent up plumes of smoke nearby.

But the backdrop to the moments of revelry was a grinding conflict and widespread devastation.

Inside the Old City — home to buildings that date back centuries — the path carved by Iraqi forces leveled homes, shattered priceless architecture and littered the narrow alleys with corpses decomposing in the summer heat.

Heba Walid held her sister-in-law's baby, which was born into war. The parents of the 6-month-old, along with 15 other family members, were killed last month when an airstrike hit their home. When Walid ran out of formula, she fed the baby a paste of crushed biscuits mixed with water.

Inside IS-held territory, the extremists are using human shields, suicide bombers and snipers in a fight to the death that has slowed recent Iraqi gains to a crawl.

Islamic State militants seized Mosul in the summer of 2014 when they swept across northern and central Iraq. That summer, the group's leader, Abu Bakr al-Baghdadi, appeared at Mosul's al-Nuri Mosque and declared a caliphate on territory it seized in Iraq and Syria.