During the course of the Syrian Civil War, the Baghuz area came under the control of the Islamic State of Iraq and the Levant jihadist organization. The area was initially administered by ISIL's Euphrates Province, but later transferred to al-Barakah district. During a multi-year campaign in eastern Syria, the town was captured from ISIL by the Syrian Democratic Forces on 23 January 2019, leaving ISIL completely besieged in the town of Al-Marashidah, to the north. However, on the next day, ISIL launched a series of suicide attacks to break the siege, allowing them to recapture parts of the town, with the town's outskirts being targeted by air raids of the international coalition. On 7 February 2019, the SDF captured Al-Marashidah and other nearby areas from ISIL, completely besieging ISIL in the town of Al-Baghuz Fawqani, the final settlement under its control in the Levant.
On 9 February 2019, the Syrian Democratic Forces, supported by the CJTF-OIR Coalition, launched a final assault to take Baghuz Fawqani and wipe out the last bastion of physical territory held by the Islamic State, opening the attack with a massive bombardment on the Huwayjat Khanafirah neighborhood, with violent clashes continuing throughout the night and into the morning hours. The Coalition said it struck a mosque in Baghuz Fawqani on 11 February, as it was being used as a command and control center by the Islamic State. On 28 February, SDF spokesman Adnan Afrin announced discovery of a mass grave found 10 days ago in the town. It contained dozens of bodies, including of men and women while heads were also found in the grave. The SDF was trying to confirm whether they were Yazidis and Islamic State members. A video of Furat FM showed a mass-grave. The outlet's executive said that most of the bodies were apparently shot in the head. SDF spokeswoman Lilwa Abdulla confirmed they found large number of Yazidi bodies though there was no specific number. However, locals said the corpses were victims of airstrikes. The assault to take the town resumed on 1 March, with the remaining ISIL militants and their families besieged and encamped at a tent city along the river. On 19 March, SDF spokesman Mustafa Bali announced that the SDF had control of all of Al-Baghuz Fawqani, with the exception for a few pockets along the shores of the Euphrates river, where intermittent clashes were still ongoing with resisting jihadists. On Saturday, 23 March 2019, SDF forces, backed by the US, retook all of Al-Baghuz Fawqani, ending ISIL's territorial rule over Syria and depriving the group of its final "capital," as well as removing almost all of the territory under their control.