BEIRUT, LEBANON - The Islamic State group, responsible for some of the worst atrocities perpetrated against civilians in recent history, appears on the verge of collapse.
After brutalizing residents living under its command for more than three years, the militants have now lost their self-proclaimed capital of Raqqa and are battling to hang on to relatively small pockets of territory in Iraq and Syria, besieged by local forces from all sides. Few, however, expect IS to completely go away, or for the bloodshed in the two countries and the region to end quickly.
Here's a look at the Islamic State group, the rise and fall of its “caliphate” and what to expect next:
IS, which emerged from the remnants of al-Qaida in Iraq, began its spread across the Mideast in early 2014, overrunning the Iraqi city of Fallujah and parts of the nearby provincial capital of Ramadi. In Syria, it seized sole control of the city of Raqqa after driving out rival Syrian rebel factions.
In June 2014, IS captured Mosul, Iraq's second-largest city, from where its leader, Abu Bakr al-Baghdadi, declared a self-styled “caliphate,” a declaration tantamount to an earthquake that would temporarily redraw borders and shake up the entire region.
IS promised justice, equality and an Islamic, religious utopia. But over the next few years, it terrorized people living under its control, systematically slaughtering members of Iraq's tiny Yazidi community, kidnapping women and girls as sex slaves, beheading Western journalists and aid workers and destroying some of the Mideast's spectacular archaeological and cultural sites.
IS also attracted a motley crew of foreign fighters, mostly marginalized European youths and other foreigners who took up its cause. But it alienated mainstream Sunni Muslims, who found IS' crude interpretation of Islam also spreading in areas far from Syria and Iraq.
Creating a territorial caliphate created a target, and an international anti-IS coalition soon took shape.
The United States launched its campaign of airstrikes against IS in Iraq in August 2014, and a month later in Syria. In Iraq, it partnered with government forces working with state-sanctioned Shiite-led militias as well as Iraqi Kurdish fighters known as peshmerga. In Syria, it partnered with local Syrian Kurdish-led fighters, the Syrian Democratic Forces.
Supported by tens of thousands of U.S.-led airstrikes, these forces drove IS militants from one stronghold after another over the years. The biggest blow came in July when Mosul, long regarded as IS' administrative capital, was liberated.
In Syria, IS appears to be heading for collapse as the U.S.-backed, Kurdish-led Syrian Democratic Forces, or SDF, and Syrian government forces, backed by their Russian allies, are attacking them in separate, simultaneous offensives.
A senior SDF commander on Tuesday said his forces liberated Raqqa from IS militants and would formally announce victory soon after clearing operations to remove land mines and search for sleeper cells. Mayadeen, a town in the heart of Syria's Euphrates River Valley near Iraq's border where the militants had been expected to make their last stand, fell to Syrian government troops over the weekend.
In northern Iraq, the jihadis no longer hold any cities or towns after their stronghold of Hawija fell earlier this month. Iraq's army is now gearing up to fight IS in its last territory - the sprawling desert Anbar province stretching all the way to the Syrian border. In Syria, IS still holds the town of Boukamal near the Iraqi border and scattered pockets of territory in the east.
The destruction of IS has come at a devastating cost for both Syria and Iraq, and immense suffering for those who endured the militants' brutal reign.
The fighting and airstrikes have pulverized once thriving cities, turning them into tragic vistas of crushed apartment blocks, flattened homes and collapsed roads and bridges. In Ramadi, Mosul and Raqqa, the scope of the damage is staggering.
Two weeks ago, the U.S.-led coalition announced it has returned more than 83 percent of IS-held land to local populations since 2014, liberating more than 6 million Syrians and Iraqis in the process. At least 735 civilians have been unintentionally killed by coalition strikes, although activists and war monitors estimate the toll to be much higher.
The nine-month battle to liberate Mosul resulted in the death of up to 1,500 Iraqi forces. At least 1,100 SDF fighters were killed in the battles for Syria's Raqqa and Deir el-Zour up until late September, according to the coalition.