Sinan Salaheddin?and Susannah George

BAGHDAD: Five weeks after a military operation began, a senior Iraqi commander declared Sunday that the city of Fallujah was “fully liberated” from the Islamic State group, giving a major boost to the country’s security and political leadership in its fight against the extremists.

Recapturing Fallujah, the first city to fall to the Islamic State group more than two years ago, means authorities can now set their sights on militant-held Mosul, Iraq’s second-largest city.

Prime Minister Haider al-Abadi, visiting central Fallujah with the celebrating troops, vowed that the Iraqi flag would next be raised above Mosul. But that campaign has been progressing in fits and starts, revealing the deep divisions among the different groups that make up the security forces.

Iraqi troops entered Fallujah’s northwestern neighborhood of al-Julan, the last part of the city under IS control, said Lt. Gen. Abdul-Wahab al-Saadi, head of the counterterrorism forces in the operation.

The operation, which began May 22, “is done, and the city is fully liberated,” al-Saadi told the Associated Press.

Al-Abadi, dressed in the black fatigues of the counterterrorism forces and carrying an Iraqi flag, visited Fallujah’s central hospital Sunday evening and called for residents of the city 40 miles west of Baghdad to celebrate the military advance.

But tens of thousands of people from Fallujah who were forced to flee their homes during the operation are still at overcrowded camps for the displaced with limited shelter in the Anbar desert. The U.S.-led coalition said it was still conducting airstrikes in the area, and aid groups warned it was too early to say when residents could return to their homes in the city, citing the presence of makeshift bombs left behind by the militants.

The Fallujah operation was carried out by Iraq’s elite counterterrorism troops, Iraqi federal police, Anbar provincial police and an umbrella group of government-sanctioned militia fighters — mostly Shiites — who are known as the Popular Mobilization Forces.

Fallujah, a predominantly Sunni city, was a stronghold of insurgents following the U.S.-led invasion in 2003. More than 100 American soldiers died and hundreds more were wounded in intense, house-by-house fighting there in 2004. Many residents of the city welcomed the Islamic State group when it overran the city in 2014.

The IS militants who had held out for more than a week on the edges of Fallujah largely collapsed early Sunday under a barrage from coalition warplanes, including a single airstrike that killed 47 fighters in the Jolan neighborhood, said Brig. Haider al-Obeidi of Iraq’s special forces.