BAGHDAD — Prime Minister Haider al-Abadi of Iraq flew to the western city of Ramadi on Tuesday to celebrate its “liberation” from the Islamic State, as jubilant, flag-waving Iraqis thronged the city’s battle-scarred streets with cars and pickup trucks.
Militants continued to hold out in several suburbs, and troops were trying to clear out car bombs that had been planted on the city’s perimeter.
While the government was not in full control of Ramadi, Mr. Abadi’s trip by helicopter under heavy guard to the city, where he visited military and police forces, was intended as a show of resolve.
Emboldened by the military success in Ramadi, he vowed to take the fight to Mosul, a larger city in northern Iraq that the Islamic State seized in June 2014.
“The Daesh gang is collapsing because of the military operations and hard strikes by our heroic forces,” Mr. Abadi wrote on Facebook, using an Arabic acronym for the Islamic State, also known as ISIS or ISIL. “The next step is to liberate Mosul and to cleanse the Iraqi lands that have been raped by the terrorist Daesh gang.”
Col. Steven H. Warren, the United States military spokesman in Baghdad, said he was confident that the Iraqis would be able to hold on to Ramadi, the capital of Anbar Province.
“We don’t think the remaining enemy has the oomph to push the Iraqi security forces off of their positions,” he said at a news conference.
Colonel Warren said that 10 Islamic State leaders had been killed in recent airstrikes, and he portrayed the gains in Ramadi as the latest in a string of successes that had put the militants on the defensive.
“This organization is losing its leadership,” he said. “We are striking at the head of this snake. We haven’t severed the head of this snake yet, and it’s still got fangs — we have to be clear about that; there’s still much more fighting to do.”
He said it would “take a while” for Iraqi forces to fully secure Ramadi, by eliminating remaining militants and by clearing out the roadside bombs, explosive-laden buildings and other “booby traps” set around the city by the Islamic State.
The Obama administration, eager to showcase a success in the fight against the Islamic State, sent out a flurry of statements and news releases on Monday hailing the Iraqi military’s seizure of Ramadi from the militant Sunni extremist group.
But the accompanying military campaign must now move quickly to capitalize on the success, Defense Department officials said, so the American-led coalition that is fighting the Islamic State does not lose crucial momentum.
That means the Iraqi military must finish clearing pockets of Islamic State resistance out of Ramadi, turn it over to a holding force of Sunni tribal fighters and move swiftly to the next stages in the war.
Those next stages include pushing Islamic State militants out of the Euphrates River valley and the Tigris River valley north of Baiji; retaking the next Anbar Province city under occupation, Falluja; and finally turning to the northern Iraqi city of Mosul, whose liberation is likely to be the last piece of the puzzle to defeating the Sunni militancy, at least in Iraq, defense officials said.
And that, administration officials acknowledge, will take months, if not years.
“Don’t forget, the enemy gets a vote, too,” Colonel Warren said Tuesday. “This is all about condition setting. We have to be able to have enough territory under our control to create supply lines, and mutually supporting staging areas, to get into Mosul.”
The key to this plan is cutting off the supply lines in Syria and elsewhere in Iraq to the Islamic State militants who are in Mosul and Falluja, which is about halfway between Ramadi and Baghdad, the capital.
On Monday, buoyed by the success in Ramadi, the American-led coalition conducted a number of airstrikes around Mosul and Falluja, destroying tunnel entrances, battle positions and bunkers.
Iraqi security forces, Pentagon officials said, have begun to approach Falluja from three directions, and are now in what officials called the “isolation” part of the campaign to retake the city. Iraqi forces are trying to encircle the city — “like a boa constrictor” — one official said, and will then move to squeeze out Islamic State fighters, much in the same way they did in Ramadi.
But Falluja is not Ramadi — it is more densely populated. The same goes for Mosul. And Islamic State militants are far more entrenched in Falluja and Mosul — where they have been for much longer — than they were in Ramadi, and that will make it more difficult to root them out, defense officials acknowledged.
A central element of the Ramadi victory was the involvement of hundreds of American-trained Sunni tribesmen who had been persuaded to join Iraq’s Shiite-led government in battling the Islamic State, a Sunni extremist group.
Ramadi is populated by Sunnis, and Mr. Abadi had promised that Sunnis would be in charge of securing the territory reclaimed from the Islamic State.
“The task of holding the ground will be the responsibility of the police of Anbar and the sons of the tribes after the liberation of Anbar,” said a military spokesman, Brig. Gen. Yahya Rasool. “The tribal fighters have been well trained and prepared and armed to hold the ground of the liberated areas.”
Suham Sabah, 55, whose family of eight survived the occupation of Ramadi, said in a phone interview that her nephew had been killed by Islamic State militants.
“Our life was hell under ISIS,” she said. “One day a mortar fell on our house — we didn’t know where it came from — and it injured four members of my family.”
It took the Iraqi security forces six months to retake Ramadi, after government troops fled the city in May under an Islamic State onslaught. Islamic State fighters used a sandstorm to help seize a critical military advantage in the early hours of their attack on the city; the sandstorm delayed American warplanes and kept them from carrying out airstrikes to help the Iraqi forces.
In July, American and Iraqi officials announced an offensive to retake Ramadi from Islamic State militants, and American officials said that around 3,000 newly American-trained Iraqi troops, along with 500 trained Sunni tribal fighters, were being deployed to help in the offensive. Iraqi security forces began isolating and cordoning off, but were slowed by hot weather, entrenched Islamic State fighting positions and other factors.
In the interim, 2,500 additional Sunni fighters were trained to help hold Ramadi once it was retaken. But that did not happen until Monday, when the government center was finally seized by Iraqi forces, who unfurled the Iraqi flag.
The liberation of Ramadi is a “much-needed tactical victory” for the Iraqi government, and one that will erode the territorial integrity of the Islamic State’s area of operation in Iraq, said Landon Shroder, an intelligence analyst for corporations in Iraq.
But, he added, “unfortunately, the battle for Falluja will be just as hard as the fight for Ramadi, given that the Islamic State has maintained a presence in the city since January 2014 and has strengthened their defenses accordingly.”
“Falluja also offers the Islamic State significant tactical advantage in conducting acts of terrorism in Baghdad, which will be used to offset any pressure during the initial assault on the city,” Mr. Shroder said.
On Tuesday, the Pentagon provided a list of 10 midlevel Islamic State officials who they said had been killed in airstrikes in December. Two of those killed, defense officials said, had links to the network behind the Nov. 13 attacks in Paris: Abdul Qader Hakim, who was killed in an airstrike in Mosul on Saturday; and Charaffe al-Mouadan, an Islamic State member with links to Abdelhamid Abaaoud, the suspected ringleader of the Paris attacks. Mr. Mouadan was actively planning attacks against the West, Pentagon officials said.