BAZWAYA, Iraq — Iraqi commanders on Tuesday said they were fighting inside an industrial district on the outer edge of Mosul, making their first breach into the city that has been under Islamic State control for nearly two and a half years.

Soldiers from Iraq’s elite counterterrorism force said they had entered the neighborhood of Gogjali on Tuesday morning. From the village of Bazwaya, just four miles to the east, jets circled overhead and explosions could be heard from the front lines.

“Right now I’m in the middle of Gogjali,” said Lt. Gen. Abdelwahab al-Saedi, a commander with the counterterrorism forces, speaking by phone. “We are dealing with pockets of resistance and booby traps.”

The elite Iraqi troops are making a sharp push into the city from the east, but other forces on other fronts remain farther away, exposing advancing troops to attack from their flanks as they press forward.

At the village of Bazwaya there was a fresh crater in the road from an early morning car bomb attack. The Islamic State militants attacked using a sand-colored Humvee, flying the Iraqi flag, in an attempt to look like a friendly Iraqi army vehicle, soldiers said.

A man who just fled Bazwaya village carries a white flag as he arrives at a special forces checkpoint, east of Mosul Monday. Reuters/Zohra Bensemra

A man who just fled Bazwaya village carries a white flag as he arrives at a special forces checkpoint, east of Mosul on Monday. Reuters/Zohra Bensemra

“We knew it was the enemy as there are only counterterrorism forces here,” said First Lt. Baraa al Sultani, noting that special forces Humvees are black. “We opened fire.”

He said their troops managed to detonate it and it exploded without causing casualties.

“There are still sleeper cells around in the villages,” said one special forces captain who declined to be named because he was not authorized to speak to the media. He said he had just returned from inside Gogjali.

On the main road to the frontlines, small convoys of civilians could be seen leaving, holding white flags out of their windows as they drove.

Mosul, a city of more than a million people, is the heart of the Islamic State’s self-proclaimed caliphate.

Speaking on state television on Monday, Prime Minister Haider al-Abadi assured civilians that his forces were close and urged people to stay in their homes.

Commanders say they have little ability to predict how much resistance security forces will face inside the city.

Since the operation to retake Mosul was launched two weeks ago, the militants have abandoned some villages, while in others, they have sent streams of car bombs at the military’s lines. Much will depend, some say, on whether civilians decide to aid the advancing forces as much as they can.

Lt. Gen. Abdul Ghani al-Asadi, head of the special forces, said Monday night his troops were moving faster than expected.

Abadi called on civilians to try to expel the militants and prevent them from putting booby traps in neighborhoods. But the presence of so many people also complicates air support from the U.S.-led coalition, which Iraqi forces rely on heavily.

Still, commanders appeared buoyed by their progress on Monday. “Nothing will be hard for us,” Asadi said.

On Monday, the elite units, which have led most of the country’s battles against the militants, retook Bazwaya, the last village between them and the city. Asadi said he had expected the fight there to take two or three days, but it lasted six hours. The militants dispatched three cars rigged with bombs, but they were all detonated by airstrikes, he said.

How fiercely the militants decide to fight may depend on whether they are penned into the city. Iraq’s array of Shiite militia forces, known as the Hashd Shaabi, joined the Mosul fight over the weekend, ringing the city on the western side, cutting the militants’ supply routes from Syria.

Still, initially at least, a route will be left for them to escape, to ease the fight for security forces inside the city, said Hadi al-Amiri, the head of the Badr Organization, one of Iraq’s most powerful Shiite armed groups, speaking in the newly retaken village of Zargah, southwest of Mosul, on Monday.

“We will cut the head off Daesh and will destroy them,” the prime minister told the state news agency al-Iraqiya, using an alternative name for the group. “Daesh has no part in Iraq.”