BEIRUT (Reuters) - The battle for the city of Raqqa, which Islamic State had used as its headquarters in Syria, is drawing to an end. Islamic State militants have lost swathes of land to various offensives across Syria and Iraq, forced into a diminishing foothold along the Euphrates river valley. Their defeat in Raqqa would be a milestone in the fight to roll back the theocratic  caliphate  Islamic State declared in 2014 in both countries. Following are some facts about Raqqa: Raqqa sits on the Euphrates river around 90 km (56 miles) from the Turkish border in north central Syria.  Hardline Sunni militant group Islamic State overran Raqqa in January 2014, seizing control from rebel factions opposed to the rule of Syrian President Bashar al-Assad. The United States has said Islamic State planned and sent teams from Raqqa to carry out attacks on cities including Paris, Brussels and Istanbul.  THE ANTI-IS OFFENSIVE The Syrian Democratic Forces (SDF), an alliance of mostly Kurdish and Arab militias, began to advance towards Raqqa city in November 2016. After encircling the city, they launched the offensive to take it, facing tough resistance.  The United States-led coalition supports the SDF with air strikes and special forces on the ground.  The battle for Raqqa has taken a severe toll on civilians. The United Nations said in March the city contained around 200,000 people, just under its pre-war population.  Since late last year, fighting around and in Raqqa has displaced tens of thousands of people. Many have fled the city to camps in surrounding territory now under the control of the SDF and its strongest component, the Kurdish YPG militia.  Civilians trapped inside the Islamic State enclave in the city have endured miserable conditions for months, lacking water, power, food and healthcare. Parts of Raqqa that the SDF captured have mostly been cleared of residents.     Air strikes, fighting and Islamic State snipers and mines have killed many hundreds of people.   The coalition says it is careful to avoid civilian casualties in its bombing runs in Syria and Iraq. But the U.N. human rights office and rights group Amnesty International have raised concerns about reports of high civilian deaths.  Islamic State has imposed its very strict interpretation of Islamic law on Raqqa s residents. The fighters have carried out public executions, lashings and violent punishments for infringements of their rule. The Raqqa campaign has stirred tension between the United States and NATO-ally Turkey. Potential Kurdish influence in the future of the mainly Arab city is sensitive both for some activists from Raqqa and for Turkey.   The YPG has become the main U.S. partner in the fight against Islamic State in northern Syria. Ankara views it as a Syrian extension of the Kurdistan Workers Party (PKK), which has waged a three-decade insurgency within Turkey, and fears growing Kurdish power along its border. The SDF s political allies have set up a Raqqa Civil Council of people from the city, which the SDF says it will hand control to once its fighters have defeated Islamic State. This echoes the pattern in other towns and cities that the SDF captured. The U.S.-led coalition has helped train a new police force for the city.  Islamic State has made enemies of all sides in the more than six-year Syrian conflict, with separate offensives now trying to clear it from its last foothold in the towns along the Euphrates river in eastern Syria near the Iraqi border. Besides the U.S.-backed SDF, the Syrian army, with Russian jets and Iran-backed militias, is also waging its own campaign against Islamic State in eastern Syria.     A modern-day provincial transport hub and market town, Raqqa was built by the Abbasid Islamic Caliphate in the eighth century, serving as its capital at one point. It has been inhabited since antiquity and contains important archaeological and architectural sites. The United Nations has said they have been extensively looted during the war and religious buildings have been damaged. Islamic State militants released a video of them bombing a large part of the Uwais al-Qarani shrine complex in March 2014. 