BAZWAYA, Iraq -- Iraq’s special forces entered the outskirts of Mosul on Tuesday and were advancing toward its more urban center despite fierce resistance by Islamic State of Iraq and Syria (ISIS) fighters who hold the city, an Iraqi general said.

It was the first time Iraqi troops have set foot in the city, Iraq’s second largest, in over two years. The advance could be the start of a grueling and slow operation for the troops, who will be forced to engage in difficult, house-to-house fighting in urban areas that is expected to take weeks, if not months.

Troops entered Gogjali, a neighborhood inside Mosul’s city limits, and by noon were only 800 yards from the more built-up Karama district, according to Maj. Gen. Sami al-Aridi of the Iraqi special forces.

“The special forces have stormed in,” he said. “Daesh is fighting back and have set up concrete blast walls to block off the Karama neighborhood and our troops’ advance,” he said, using the Arabic acronym for ISIS. Bombs have been laid along the road into the city, he added.

Get Breaking News Delivered to Your Inbox

Mosul is the final ISIS bastion in Iraq, the city from which it drove out a larger but demoralized Iraqi army in 2014 and declared a “caliphate” that stretched into Syria. Its loss would be a major defeat for the jihadis, but with the closest Iraqi troops still some 6 miles from the city center, much ground remains to be covered.

Tuesday’s battle opened up with Iraqi artillery, tank and machine gun fire on ISIS positions on the edge of Gogjali neighborhood, with the extremists responding with guided anti-tank missiles and small arms in an attempt to block the advance. Airstrikes by the U.S.-led coalition supporting the operation added to the fire hitting the district.

Spokesman Col. John Dorrian said that the U.S.-led coalition, which coordinates all its attacks with the Iraqis, has been observing the battlefield and has noted that ISIS forces can no longer move in large numbers.

“And when we see them come together where there are significant numbers we will strike them and kill them,” he said during a televised press conference with Iraqi forces in Qayara, south of Mosul. Concerns over civilian casualties have led to air operations using precision munitions only, he added.

From the nearest village east of Mosul, Bazwaya, smoke could be seen rising from buildings in Gogjali, where shells and bombs had landed. ISIS fighters also lit special fires to produce dark smoke in order to obscure the aerial view of the city.

Inside the village, white flags still hung from some buildings, put up a day earlier by residents eager to show they wouldn’t resist the Iraqi forces’ advance. Some residents stood outside their homes, and children raised their hands with V-for-victory signs.

The families, estimated to number in the hundreds, will be evacuated from the village to a displaced persons camp, according to Brig. Gen. Haider Fadhil of the Iraqi special forces.

As the fighting raged, several of the newly displaced from Bazwaya could be seen carrying white flags and driving a herd of some 150 sheep toward the camp.

Emad Hassan, 33, a former policeman, said he had come to Bazwaya when the operation started in order to flee the ISIS fighters.

“When I knew the security forces were serious about liberating Mosul, I came here,” he said. “Daesh was preventing families from moving toward the security forces and ordered them into the city center, but I refused and stayed.”

For over two weeks, Iraqi forces and their Kurdish allies, Sunni tribesmen and Shiite militias have been converging on Mosul from all directions to drive ISIS from the city.

Iraqi forces have made uneven progress in closing in on the city. Advances have been slower to the south, with government troops still 20 miles away. To the north are Kurdish forces and Iraqi army units, and Shiite militias are sweeping toward the western approach in an attempt to cut off a final ISIS escape route.

The Shiite forces, Iran-backed troops known as the Popular Mobilization Units, are not supposed to enter Mosul, given concerns that the battle for the Sunni-majority city could aggravate sectarian tensions.

Just behind the eastern front line, the army’s ninth division has moved toward Mosul on the path cleared by the special forces, and was now approximately 2 miles from its eastern outskirts.

The U.S. military estimates ISS has 3,000-5,000 fighters in Mosul and another 1,500-2,500 in its outer defensive belt. The total includes about 1,000 foreign fighters. They stand against an anti-ISIS force that including army units, militarized police, special forces and Kurdish fighters totals over 40,000 men.

According to a video published online by ISIS, life was normal inside Karama district a day earlier. Released by its Aamaq news agency, the footage from Karama shows residents insisting that life is normal and that “no apostates or Shiites” had entered the city

“We hear the thud of the bombs fired by our brothers at the apostates,” said a bearded man in a wheelchair, speaking from a market street where taxis and shoppers passed by unimpeded.

As the Mosul offensive has pressed on, bombings have continued in the capital, Baghdad, part of sustained ISIS efforts to destabilize the country. Dozens have been killed since the push on Mosul started in apparent retaliation attacks, mostly claimed by ISIS.