A boy looks out from a car window at a checkpoint near Qayara, south of Mosul, Iraq, Tuesday, Nov. 1, 2016. The U.N. human rights office is lauding efforts by the U.S.-led coalition in the battle against the Islamic State group in Mosul. The office in Geneva says coalition flights over Iraq have largely succeeded in preventing IS from bringing in 25,000 more civilians to the city center, where the militant group has been using people as human shields as Iraqi forces advance on Mosul.(AP Photo/Felipe Dana)
A boy looks out from a car window at a checkpoint near Qayara, south of Mosul, Iraq, Tuesday, Nov. 1, 2016. The U.N. human rights office is lauding efforts by the U.S.-led coalition in the battle against the Islamic State group in Mosul. The office in Geneva says coalition flights over Iraq have largely succeeded in preventing IS from bringing in 25,000 more civilians to the city center, where the militant group has been using people as human shields as Iraqi forces advance on Mosul.(AP Photo/Felipe Dana) Credit: Felipe Dana

Bazwaya, Iraq — Despite suicide attacks, snipers and roadside bombs, Iraqi commandos swept into the eastern edge of Mosul on Tuesday, setting foot in the city for the first time since it was seized by Islamic State militants more than two years ago.

It was a rapid and symbolic incursion into the northern Iraqi city at the heart of the militant group’s self-proclaimed “caliphate.” But bringing the fight into Mosul’s limits does not change the overall challenges facing Iraqi troops trying to oust the militants from their last major stronghold in Iraq. Ahead lie booby-trapped defense lines, networks of tunnels and neighborhoods packed with civilians.

Explosions and heavy exchanges of gunfire could be heard from Mosul’s Gogjali district as Iraq’s elite counterterrorism forces battled to retake it on Tuesday. Jets streaked overhead.

Iraqi commanders and U.S. officials say they can only guess how hard the militants will fight for the city, the most populous that the Islamic State controls.

While it is central to the group’s state-building aspirations, it is also a prize the militants appear likely to lose. Tens of thousands of Iraqi and Kurdish troops have closed in since the launch of an ambitious offensive just over two weeks ago, backed by air and artillery strikes by a U.S.-led coalition. More than 1 million civilians are said to remain in Mosul, and the militants have kidnapped the people of entire villages on the city’s outskirts to use as human shields.

“There was desperate resistance by the enemy,” said Lt. Gen. Abdelwahab al-Saedi, a commander with Iraq’s counterterrorism forces. By the end of the day, Gogjali had largely been secured, although mines, explosives and some “pockets” of resistance were still being cleared, he said. The elite forces were building on their momentum and moving deeper into Mosul, fighting on the edge of neighborhoods farther west, he said.

The speed of the gains, however, appeared to come at the expense of thorough operations to secure and clear territory as government forces advanced.

The elite Iraqi troops are making a sharp push into Mosul from the east. But forces on other fronts remain farther away, exposing advancing troops to attack from their flanks as they attempt to press forward. The militants’ extensive network of tunnels allows them to evade airstrikes and launch surprise attacks.