Michael R. Gordon, a Times correspondent, went with the Iraq counterterrorism force to the old city of Mosul, where Islamic State fighters are hemmed in and civilians are trapped.

Perched on a rooftop near the ruins of the Al Nuri Grand Mosque, Lt. Gen. Abdul-Wahab al-Saadi used a rock to sketch out the endgame for Mosul.

The Islamic State was down to perhaps 150 fighters, hemmed in on all sides, defending a bastion that seemed to be shrinking by the day, said the general, a senior commander in Iraq’s counterterrorism service.

On a visit to the old city of Mosul on Wednesday with General Saadi and his men, it was clear that the militants’ resistance was still fierce and often fanatical, even by the Islamic State’s macabre standards.