U.S.-backed forces declared military victory over the Islamic State group in Syria today (Sat) after liberating the last pocket of territory held by the militants, marking the end of a brutal self-styled caliphate the group carved out in large parts of Iraq and Syria in 2014.

The nearly five-year war that has devastated cities and towns across north Syria and Iraq ended in Baghouz, a minor border village where the cornered militants made their last stand, under a grueling siege for weeks.

Today, the Syrian Democratic Forces raised their bright yellow banner from a shell-pocked house where the militants once flew their notorious black flag.

Below it stretched a field shattered by the battle, pitted by trenches and bomb craters and littered with scorched tents, twisted wreckage of burned out vehicles, unspent explosives and few remaining corpses.

“Baghouz is free and the military victory against Daesh has been achieved,” tweeted Mustafa Bali, a spokesman for the Kurdish-led SDF, referring to IS by its Arabic acronym.

The fall of Baghouz brings to a close a nearly 5-year global campaign against the Islamic State group that raged in two countries, spanned two U.S. presidencies and saw a U.S.-led coalition unleash more than 100,000 strikes.

The campaign has left a trail of destruction in cities in Iraq and Syria, likely killed tens of thousands and drove hundreds of thousands from their homes.