A US-backed alliance of Syrian fighters has announced that the jihadist group Islamic State (IS) has lost the last pocket of territory in Syria it controlled, bringing a formal end to the "caliphate" it proclaimed in 2014.
IS once controlled 88,000 square kilometres of territory stretching from western Syria to eastern Iraq. It imposed its brutal rule on almost eight million people, generating billions of dollars in revenue from oil, extortion, robbery and kidnapping.
Despite the demise of its physical caliphate, IS remains a battle-hardened and well-disciplined force whose "enduring defeat" is not assured.
The head of the US military's Central Command, Gen Joseph Votel, said in February that it was necessary to maintain "a vigilant offensive against the now largely dispersed and disaggregated [IS] that retains leaders, fighters, facilitators, resources and the profane ideology that fuels their efforts".
And if pressure on the group is not sustained, IS "could likely resurge in Syria within six to 12 months and regain limited territory in the Middle Euphrates River Valley", military officials told the US Department of Defense Office of the Inspector General in January.
Such warnings appeared to persuade Mr Trump not to withdraw all of the 2,\000 US troops from Syria, as he had promised in an announcement in December 2018. That plan prompted the resignation of Defence Secretary Jim Mattis and alarmed allies in the Global Coalition to Defeat IS.
The White House said in February that it would leave 400 "peacekeepers" in Syria for a "period of time", 200 of which would be based at the al-Tanf outpost, at the intersection of the Syrian, Jordanian and Iraqi borders.
What next for IS?
In Iraq, where the government declared victory in December 2017, the jihadist group has already "substantially evolved into a covert network", UN Secretary General António Guterres said in a report to the Security Council released in February.
"It is in a phase of transition, adaptation and consolidation. It is organising cells at the provincial level, replicating the key leadership functions," he added.
IS militants are active in rural areas with remote, rugged terrain that gives them freedom to move and plan attacks. These include the deserts of Anbar and Nineveh provinces, and the mountains that straddle Kirkuk, Salah al-Din and Diyala provinces.
Cells "appear to be planning activities that undermine government authority, create an atmosphere of lawlessness, sabotage societal reconciliation and increase the cost of reconstruction and counter-terrorism", according to Mr Guterres. These activities include kidnappings for ransom, targeted assassinations of local leaders, and attacks against state utilities and services.
The IS network in Syria is expected to evolve to resemble that in Iraq.
Besides the Euphrates valley, the group has a presence in the opposition-held north-western province of Idlib, in government-held areas south of the capital Damascus, and in the Badiya region, a vast stretch of desert in south-eastern Syria.
The militants have access to heavy weapons, and are able to carry out bombings and assassinations throughout the country, according to the US defence department's inspector general. Their leaders also retain "excellent command and control capability".
The location of the group's overall leader, Abu Bakr al-Baghdadi, is not known. But he has eluded being captured or killed, despite having fewer places to hide.
IS continues to generate revenue through criminal activities. It also receives external donations and is estimated to have between £39m-231m in cash.
How many militants are left?
IS has suffered substantial losses, but Mr Guterres said it still reportedly controlled between 14,000 and 18,000 militants in Iraq and Syria, including up to 3,000 foreigners.
The US Special Envoy to the Global Coalition To Defeat IS, James Jeffrey, said in mid-March that Washington believed there were still between 15,000 and 20,000 IS "armed adherents active" in the region, many of them in sleeper cells.
The US defence department's watchdog was told by the Global Coalition in July 2018 that there were between 15,000 and 17,000 IS militants in Iraq and between 13,000 and 14,000 in Syria. However, US commanders subsequently said they did not have a lot of confidence in those figures.
The SDF has captured about 1,000 foreign IS fighters. Hundreds of women and more than 2,500 children associated with foreign fighters are meanwhile living in camps for displaced people in SDF-controlled areas. There are also reported to be about 1000 foreign fighters in detention in Iraq.
The US has called for the repatriation of the SDF's captives for prosecution. But their home countries have raised concerns about bringing hardened IS members back and the challenges of gathering sufficient legal evidence to support prosecutions.
Up to 40,000 foreigners are estimated to have travelled to fight in Syria and Iraq in total.
The actual number of people still making the journey is unknown, but the flow has reduced significantly. The Global Coalition estimated that it was "most likely 50 per month".
The net flow of foreign fighters away from Iraq and Syria is also said to be low. As of October 2017, more than 5,600 had returned to their home countries.
Meanwhile, there are significant numbers of IS-affiliated militants in Afghanistan, Egypt, Libya, South-East Asia and West Africa, and to a lesser extent in Somalia, Yemen, Sinai and the Sahel.
Individuals inspired by the group's ideology also continue to carry out attacks elsewhere.