ISTANBUL — After two months, the battle to retake the Iraqi city of Mosul from the Islamic State has settled into a grinding war of attrition. The front lines have barely budged in weeks. Casualties of Iraqi security forces are so high that American commanders heading the United States-led air campaign worry that they are unsustainable. Civilians are being killed or injured by Islamic State snipers and growing numbers of suicide bombers.

As the world watches the horrors unfolding in Aleppo, Syria, where government forces and allied militias bombed civilians and carried out summary executions as they retook the last rebel-held areas, a different tragedy is transpiring in Mosul. Up to one million people are trapped inside the city, running low on food and drinking water and facing the worsening cruelty of Islamic State fighters.

“ISIS members have become like mad dogs, and every member has the power of immediate execution,” Abu Noor said by telephone from his home on the west side of Mosul, which government forces had not reached, referring to the terror group by one of its acronyms. “We live in constant fear and worry.”

As the fight drags on, it is looking more and more likely that Mosul will become one of the first national security issues facing President-elect Donald J. Trump when he takes office next month. While American forces have largely steered clear of the fighting in Syria, they are deeply involved in operations just over the border in Iraq, mainly in training, advising and support roles.