The city of Raqqa has been completely liberated from the Islamic State after a four-month battle, a U.S.-backed force and the the Syrian Observatory for Human Rights monitoring group said Tuesday.

Brig. Gen. Talal Sillo, a commander with the Kurdish forces fighting the extremists, told The Associated Press that the clashes in the city had ended.

He said a formal declaration will follow regarding “the fall of the capital of terrorism.”

It came after U.S.-backed forces captured the city hospital in Raqqa, leaving the militants holed up at the city stadium.

The hospital was one of ISIS' last holdouts in Raqqa — formerly its de facto capital — and also served as a command center. After it was captured, the militants were cornered in and around the stadium, which they used as a prison.

The U.S.-backed Kurdish and Arab militias later raised a flag inside the stadium. They were clearing it of mines and any hiding militants, said Rojda Felat, commander of the Raqqa campaign for the Syrian Democratic Forces (SDF), according to Reuters.

“We do still know there are still IEDs and booby traps in and amongst the areas that ISIS once held, so the SDF will continue to clear deliberately through areas,” said Colonel Ryan Dillon, a spokesman for the U.S.-led Operation Inherent Resolve coalition, Reuters reported.

Musafa Bali, a spokesman for the SDF, said 22 ISIS militants were killed in the advance on the hospital.

Losing Raqqa, which ISIS seized from other Syrian rebels in early 2014, is a symbolically huge blow for ISIS, which has steadily lost territory in Iraq and Syria, including Iraq’s second largest city of Mosul in July.

More:'White Widow' female terrorist killed in U.S. drone strike: reports

Contributing: The Associated Press