Iraq announced the beginning of its offensive for the northern city of Mosul on Monday, embarking on the country’s biggest fight against Islamic State militants so far.

In an early-morning televised address, Prime Minister Haider al-Abadi pledged to raise the Iraqi flag over the city once more, calling on residents to cooperate with the advancing forces.

The operation aims to push the militant group out of its de facto capital in Iraq, the most populous city it controls. More than 1 million civilians are thought to be trapped in the city.

Tens of thousands of Iraqi troops from an array of the country’s forces have been drawn together to achieve that feat: Kurdish peshmerga soldiers, Sunni tribal fighters, army troops, police officers, Shiite militias and elite counterterrorism units. From the sky and on the ground comes close support from the U.S.-led coalition.

Despite sometimes competing agendas, they have united — at least for now — to take back the Islamic State’s most prized remaining territory in the country.

Mosul, about 250 miles north of Baghdad, is the Islamic State’s last major stronghold in Iraq, and the city has come to symbolize the group’s rise here. It was in Mosul’s Great Mosque that Islamic State leader Abu Bakr al-Baghdadi announced his self-proclaimed caliphate more than two years ago.

But since then, the group’s grip has slowly crumbled. Tikrit, Ramadi and Fallujah have been clawed back by Iraqi forces, albeit with a heavy reliance on U.S.-led airstrikes.

It’s only a matter of time before Mosul is recaptured, too, Abadi said.

“We will soon meet in Mosul to celebrate in liberation and your salvation,” he said, addressing the people of the city. “We will rebuild what has been destroyed by this criminal gang.”

Early Monday, U.S.-led coalition artillery and airstrikes bombed areas where ground troops were expected to advance after sunrise, said one military official, who spoke on the condition of anonymity to discuss an ongoing operation.

Dozens of ambulances were lined up at checkpoints on the edges of Iraq’s northern region of Kurdistan, ready to ferry out casualties. Thousands of Iraqi troops have moved into position for the battle in recent weeks, as new military staging areas have sprung up along front lines.

More than 80,000 troops are involved, including engineers and logistical support, said Maj. Salam Jassim, a commander with Iraq’s elite special forces.

At a staging area in a hamlet near Khazir, east of Mosul, Jassim and his men were waiting for the order for “zero hour.” In houses emptied by fighting, soldiers entertained themselves with games of cards and dominoes. Battle plans were drawn out in black marker on walls and plastic tables.

“We’ll take it,” Jassim said, sipping on a can of Tiger Energy Drink, a favorite of Iraqi forces. “There’s no doubt.”

As well as here to the east of the city, Iraqi army and police forces are also moving in from Qayyarah air base, about 35 miles south, pushing up the main highway from the capital Baghdad, 250 miles away.

Trucks packed with Iraqi soldiers and military vehicles have clogged the roads as forces have moved into place. Tanks, armored vehicles and weaponry have been hauled from the capital.

Initially, the offensive on the eastern front will be led by Kurdish forces known as peshmerga, Iraqi military officers said. They are expected to advance to the edges of territory over which they have long disputed control with Baghdad, before stopping.

“We’ll start after them and move after them to support them,” said Brig. Gen. Haider Obaidi, another commander with Iraq’s special forces.

Shiite militia forces are also expected to play a role. But they are not part of the force that’s authorized to enter the city, in light of fears about sectarian abuses in the majority Sunni city and how their advance would be perceived.

The military official said that a planned simultaneous offensive from the north would not go ahead on Monday, although he said he wasn’t aware why.

On Sunday night, Defense Secretary Ashton B. Carter said in a statement that “the United States and the rest of the international coalition stand ready to support” the effort, and he added that “we are confident our Iraqi partners will prevail against our common enemy and free Mosul and the rest of Iraq from ISIL’s hatred and brutality.”

Opinions are split on just how long and grinding the battle will be. Abadi has pledged to have the city back under Iraqi government control by the end of the year.

But Jassim is not sure that’s possible, with booby traps and explosive devices expected to slow the way. The Islamic State has fortified its defenses of the city in recent months, erecting concrete blast walls and digging trenches.

Civilians, too, will complicate the battle. Between 1.2 million and 1.8 million are still in the city, he said.

To avoid a humanitarian crisis, the Iraqi government has asked civilians to stay in their homes, complicating air support and clearing operations to clear neighborhoods of militants.

“The operation will take much longer because of this,” Obaidi said. “For their safety, but it also means each neighborhood needs to be surrounded and searched as we clear it.”

Still, the U.S.-led coalition will give closer support than in any other operation, he said, and Apache helicopters probably will be used. On Sunday night, preparatory airstrikes rattled windows in the special forces base near Khazir.

The coalition has requested that the airspace be cleared of Iraqi jets, whose air support will be limited to the areas where Shiite militias are on the ground, Obaidi said.

“All the sky will be for the coalition,” he added. The western side of the city will be left largely open, which may make for a less protracted fight inside than if it was besieged. “We’ll try to give them an escape to run to Syria,” Jassim said of the militants.

Brig. Gen. Yahya Rasoul, a spokesman for the Iraqi military, said that even if the western side is left open, it doesn’t mean a safe escape for the Islamic State. “If we do that, then this area will become a killing zone as we target them with our aircraft,” he said.

Missy Ryan in Washington contributed to this report.