Iraqi commanders said Sunday that they had completely retaken the city of Fallujah after a month-long battle, depriving Islamic State militants of a symbolic stronghold just an hour’s drive from the capital.

There was a celebratory mood in the city as pickup trucks ferried around cheering members of the security forces, who unloaded volleys of bullets into the air in jubilation. While the city appeared to be under their control, commanders conceded that militants could be hiding out.

The Sunni city 45 miles west of Baghdad was the first in Iraq or Syria to be captured by the Islamic State, about 2 1 / 2 years ago. Fallujah was a quagmire for U.S. service members during the Iraq War, so there were expectations that it could be a bloody and drawn-out fight this time, too. But the Iraqi military made quick progress after breaking through defense lines outside the city earlier this month. […]