ERBIL, Iraq — Mosul’s residents are hoarding food and furtively scrawling resistance slogans on walls, while the city’s Islamic State rulers have feverishly expanded their underground tunnel network and tried to dodge American drones.

After months of maneuvering, the Iraqi government’s battle to reclaim Mosul, the sprawling city whose million-plus population lent the most credence to the Islamic State’s claim to rule a fledgling nation, has finally begun. In the early hours Monday, an announcement by Prime Minister Haider al-Abadi of the campaign’s opening was accompanied by artillery barrages and a rush of armored vehicles toward the front a few miles from the city’s limits.

Those forces will fight to enter a city where for weeks the harsh authoritarian rule of the Islamic State, also known as ISIS, ISIL or Daesh, has sought to crack down on a population eager to either escape or rebel, according to interviews with roughly three dozen people from Mosul. Among them were refugees who managed to sneak out in recent weeks and residents reached by contraband cellphones in the city.