Islamic State (IS) jihadists in June 2014 proclaimed a "caliphate" across the swathes of territory they had seized in Syria and Iraq, but have since lost one territory after another.
On Thursday the US-led coalition said that recent gains by Kurdish-led forces, which it backs in Syria, have shrunk the group's "caliphate" to less than one percent of its original size.
On June 29, 2014 jihadists of the Islamic State of Iraq and the Levant (ISIL) proclaim a "caliphate" led by Abu Bakr al-Baghdadi across territory the group seized in Syria and Iraq and rebrands itself the Islamic State.
In Syria ISIL had in January seized the northern city of Raqa from rebels.
It also controls a large part of the eastern province of Deir Ezzor, on the border with Iraq, as well as positions in the northern province of Aleppo.
In Iraq, where it is backed by former officers of late dictator Saddam Hussein and Salafist groups, ISIL in June seizes Mosul and Sunni Arab areas bordering the autonomous Kurdistan region.
A badly prepared Iraqi army is routed without a fight.
Raqa and Mosul become the IS's two de-facto capitals.
In July, Baghdadi appears in a video posted on jihadist websites and calls on all Muslims everywhere to "obey" him.
In Raqa the IS carries out beheadings, mass executions, rapes, abductions and ethnic cleansing. It stones to death women suspected of adultery and slaughters homosexuals.
Some of the atrocities are broadcast on video, which the jihadists use as a propaganda tool.
In Iraq, the group seizes the historic home of the Yazidi minority in Sinjar region, making young children into soldiers and using thousands of women as sex slaves.
In August 2014, US warplanes strike IS positions in northern Iraq.
Washington then forms a coalition of more than 70 countries to fight the group in both Iraq and Syria. Washington deploys 5,000 soldiers.
Backed by US-led air strikes, Kurdish forces in January 2015 drive the jihadists out of the city of Kobane, on the Turkish border.
In August 2016, a US-backed Kurdish-Arab alliance known as the Syrian Democratic Forces (SDF), recaptures Manbij in Aleppo province.
Backed by Turkish tanks and air force rebels then retake Jarabulus, and, in February 2017, Al-Bab, the last IS bastion in Aleppo province.
In March 2017, Syrian troops backed by Russian jets recapture the ancient desert town of Palmyra from the IS.
The oasis city had traded hands several times during the war and become a symbol of the jihadists' destruction of priceless cultural heritage in areas under their control.
In October 2017, the SDF announces the full recapture of Raqa city, the capital of the eponymous province.
And in September 2018, the coalition launches an offensive against the IS's last pocket in the province of Deir Ezzor, of which it has since conquered the vast majority.
In March 2015, Iraq announces the "liberation" of Saddam's hometown of Tikrit, north of Baghdad. The operation highlights the crucial role of Hashed al-Shaabi, a Shiite-dominated paramilitary group.
In November coalition-backed Kurdish forces retake Sinjar.
In 2016, Anbar provincial capital Ramadi is recaptured and Iraqi forces retake Fallujah.
In July 2017, then Iraqi Prime Minister Haider al-Abadi declares victory in Mosul after a nearly nine-month offensive led by a federal force backed by coalition air strikes.
In August, the last major IS urban stronghold in northern Iraq, Tal Afar, is declared "liberated", as is the whole of Nineveh province.
On December 9, Abadi declares victory in the three-year war against the IS.
The jihadists, however, carry out periodic attacks.
In January 2018, a double suicide attack leaves more than 30 dead in central Baghdad. The IS has since claimed several deadly attacks in Iraq.
In Syria on January 16, 2019, a routine US patrol is targeted by a IS suicide bomber at Manbij.
Ten civilians, five fighters from the Kurdish-Arab force and four Americans are killed.
Several days later in northeastern Hasakeh province five are killed when a US-SDF convoy is attacked by a suicide bomber.