T he Isis caliphate once counted 10 million people within its borders. It stretched across two countries, contained major towns and cities, oil fields, factories and dams. Yet today, standing on a rooftop in this small hamlet in eastern Syria, it is possible to see the entire thing.

“There are less than two kilometres. We will finish them soon,” says Masloon Derbasiyeh, a 23-year-old fighter with the Syrian Democratic Forces, looking out across the last two villages under Isis control.

The thud of artillery echoes from down the road, where perhaps a few hundred mostly foreign Isis fighters are making their last stand. But hundreds of others have surrendered in recent days in the face of a blistering offensive and an almost constant barrage of airstrikes from the US-led coalition.

It will not be long before the last of the territory held by the group is captured. As Derbasiyeh and his comrades gather in the early evening, the sun is setting on the caliphate before them. But it has not been an easy fight.

The offensive to recapture this last pocket of Isis control began in September last year. By then, Isis had lost all the major cities and urban areas under its control in Syria to the SDF, and had retreated to this string of villages along the eastern bank of the Euphrates river. With nowhere else to run, many are choosing to fight to the death.

Thousands of Syrians flee last Isis territory: Richard Hall meets families fleeing from the once mighty caliphate in its dying days

“Ten people blew themselves up today,” says Derbasiyeh, a member of the Kurdish People Protection Units, or YPG. Just a day before, a number of his fellow fighters were injured when they entered a house in the village where they now stand. “There was a woman on the second floor, when they entered she blew herself up.”

Aram Kocher, another YPG fighter, says there are around 300 Isis diehards left.

Syria at war: Fleeing the caliphate Show all 14 1 /14 Syria at war: Fleeing the caliphate Syria at war: Fleeing the caliphate Trucks full of women and children arrive from the last Isis-held areas in Deir ez-Zor, Syria Richard Hall/The Independent Syria at war: Fleeing the caliphate Zikia Ibrahim, 28, with her two-year-old son and 8-month-old daughter, after fleeing the Isis caliphate Richard Hall/The Independent Syria at war: Fleeing the caliphate Trucks full of women and children arrive from the last Isis-held areas in Deir ez-Zor, Syria. Richard Hall Richard Hall/The Independent Syria at war: Fleeing the caliphate Men who fled the last Isis-held area of Syria line up to be questioned by American and Kurdish intelligence officials Richard Hall/The Independent Syria at war: Fleeing the caliphate Trucks full of women and children arrive from the last Isis-held areas in Deir ez-Zor, Syria. Richard Hall Richard Hall/The Independent Syria at war: Fleeing the caliphate A young girl pulls her belongings after arriving Richard Hall/The Independent Syria at war: Fleeing the caliphate An SDF fighter hands out bread to women and children after they arrive Richard Hall/The Independent Syria at war: Fleeing the caliphate Sita Ghazzar, 70, after fleeing from the last Isis-held territory in Syria Richard Hall/The Independent Syria at war: Fleeing the caliphate A family from Russia who recently fled the last Isis-held area of Syria Richard Hall/The Independent Syria at war: Fleeing the caliphate Trucks full of women and children arrive from the last Isis-held areas in Deir ez-Zor, Syria. Richard Hall Richard Hall/The Independent Syria at war: Fleeing the caliphate Trucks full of women and children arrive from the last Isis-held areas in Deir ez-Zor, Syria. Richard Hall Richard Hall/The Independent Syria at war: Fleeing the caliphate Trucks full of women and children arrive from the last Isis-held areas in Deir ez-Zor, Syria. Richard Hall Richard Hall/The Independent Syria at war: Fleeing the caliphate Trucks full of women and children arrive from the last Isis-held areas in Deir ez-Zor, Syria. Richard Hall Richard Hall/The Independent Syria at war: Fleeing the caliphate Richard Hall Richard Hall/The Independent

“The locals have already gone. The ones left are foreigners, a lot from Chechnya and Russia. They are the most experienced and the most radicalised,” he says. “It has not been easy.”

The SDF, an alliance of Kurdish and Arab fighters backed by the US, has suffered hundreds of casualties in this last battle. The militia is often referred to as being “Kurdish-led” because the majority of its fighters are Kurdish, but this battle is being fought mostly by locals from the Deir ez-Zor area, the sons of tribes who have been ravaged by Isis. They are young, and not as well equipped as the more experienced Kurdish fighters of the YPG.

SDF fighters gather near the front line against Isis in the village of Baghouz Tahtani, eastern Syria (Richard Hall/The Independent)

The ferocity of the fight can be seen on the road to the front line. A trail of destruction leads the way to the edge of Baghouz Fawqani, ahead of which lies the last Isis-held territory. Village after village after town, with no space between them, lies in ruins. Mines left behind by Isis litter the area.

As they have done in previous battles, the SDF relied heavily on US airpower to advance. The airstrikes have caused dozens, perhaps hundreds of deaths. In the last week alone, more than 44 civilians have been killed in US airstrikes and artillery, according to Airwars, an independent monitoring group. The coalition carried out a massive 939 air and artillery strikes in the area in December, according to the group.

The ones left are foreigners. They are the most experienced and the most radicalised Aram Kocher, YPG fighter

As the final days approach, many who have stayed with the caliphate until the very end are now leaving it behind. US officials had long believed that this area was home to the Isis top leadership, among them the group’s founder and leader, Abu Bakr al-Baghdadi. But only a handful have emerged, suggesting many may have escaped.

Although many Isis members have surrendered, others are attempting to hide among civilians and live to fight another day. At a desert outpost about 10 miles east of the fighting, US special forces and Kurdish intelligence units attempt to sort the fighters from the civilians. The men are lined up, questioned and their fingerprints taken. At least seven men in one group are detained on suspicion of being fighters, the rest will face further questioning.

One of those held is Alexander Bekmirzaev, 45, who was picked up in early January trying to leave the area with a group of civilians. A native of Belarus who became an Irish citizen in 2010, he is now in the custody of the SDF, but denies he was ever an Isis member. He describes the chaos of the last few months in the area.

“Towards the end, I don’t know what kind of bombs they developed, but they were three times the size of this room,” he tells The Independent. “They were bombing every day and night. People were trying to leave all the time.”

He says he saw foreign fighters paying money to Isis secret police to be smuggled out of the area, only to be delivered to the waiting Kurdish forces.

“People were paying them so much money. $4,000 to go to Idlib. Turkey was $8,000. But they ended up on the first checkpoint of the Kurds. They are thieves. Real criminals.”

Masloon Derbasiyeh, a 23-year-old fighter with the Syrian Democratic Forces, near the front line with Isis, in the last days of the caliphate (Richard Hall/The Independent) (Richard Hall / The Independent)

The fighters aren’t the only ones leaving. In the last month, more than 25,000 women and children have fled the rapidly shrinking caliphate. The scale of the exodus has shocked officials, and left them struggling to cope.

The ongoing fighting, and mines left by Isis themselves, makes escape extremely dangerous, but the remoteness of the front lines has made the journey even deadlier. Those fleeing are forced to walk for days to reach a point at which they can be picked up by trucks and taken to safety. At least 29 children have died making the journey, or shortly after, in the past month, according to the World Health Organisation. Eighteen of these children have died over the past week, mostly of malnourishment and hypothermia.

The Independent witnessed two evacuations this week of more than 1,800 people – mostly women and children. Many of those fleeing were from Iraq, others from Kazakhstan and Russia, and could not speak any Arabic.

SDF officials believe hundreds of families of Isis members who had populated the area are now leaving. They too, face suspicion. As they arrive, having not eaten for days and gasping for water, they are lined up on the ground and questioned.

“I came out with my husband, but he didn’t make it,” says Sita Ghazzar, 65, on the edge of tears. “He was killed by a sniper.”

“We are civilians, we are not with Isis,” insists Zikia Ibrahim, 28, who fled with her two children – a two-year-old boy and eight-month-old baby – each of them covered in a layer of dust from the journey. “We have been walking for two days.”

Many say they came from Anbar, across the border in Iraq, after being caught up in the fighting there. Hundreds of them slump on the dry earth, exhausted from their journey. It will be another day at least before they can properly rest. After this initial questioning they are taken to Al-Hol camp, where they will face further investigation. That camp’s population has tripled in size over the past few weeks, with shortages of tents and facilities.

The battle to recapture the last of the Isis-held territory may have prompted this humanitarian disaster, but the caliphate’s defeat will mean the end of a much greater one. For four years, Isis’s physical presence enabled it to carry out atrocities on a grand scale, in the open, virtually unimpeded. It has committed genocide, murder, enacted slavery and rape within its borders, and generated the resources to carry that terror beyond them.

The caliphate has also acted as a powerful propaganda tool. It’s physical presence was central to its appeal. Baqiya wa tatamaddad – “remaining and expanding” – was its call to arms.

“The physical caliphate acted as an emblem, a marker laid down by Isis which attested to their prowess and success,” says Shiraz Maher, director at the International Centre for the Study of Radicalisation and Political Violence at King’s College London.

“That sense of ‘winning’ on the ground served as a huge rallying cry for scores of sympathisers around the world who mobilised in Islamic State’s cause.”

Despite US president Donald Trump’s assertion in December that Isis had already been “defeated”, many in his own administration are more cautious. Military and intelligence officials, too, have cautioned against declaring victory.

Trucks full of women and children arrive in the desert to the east of Hajin, near the Iraqi border, on Saturday 26 January (Richard Hall/The Independent) (Richard Hall / The Independent)

Earlier this week, top US intelligence officials said in their Worldwide Threat Assessment that Isis “still commands thousands of fighters in Iraq and Syria, and it maintains eight branches, more than a dozen networks, and thousands of dispersed supporters around the world, despite significant leadership and territorial losses”.

Colonel Sean Ryan, a spokesperson for the US-led coalition, calls the end of the physical caliphate “truly militarily symbolic”, but says the fight is not yet over.

“While significant gains have been made, we must remain focused on the enduring defeat of Isis. Only an enduring defeat will ensure they cannot regenerate their capabilities and threaten the security of the region and our homelands,” he adds.

Here in Deir ez-Zor, there is a sense of an ending. But the thoughts of the fighters are already turning to what comes next.

“We are very happy Isis is nearly finished, but everybody knows this is not the end,” says Kocher, the YPG fighter. “The geographical area may be gone, but they can still carry out attacks.”

In villages further north from here, which were recaptured more than a year ago, Isis sleeper cells are already active again. The road between Hassakeh and this part of Deir ez-Zor is not considered safe, even if it is ostensibly under the control of the SDF.

Support free-thinking journalism and attend Independent events

But it is not Isis that concerns the fighters now. They are already preparing for bigger enemies. Since the civil war began, Syria’s Kurds have taken great steps towards a long-held dream of autonomy in the areas in which they are the majority. They have set up civil councils, a bureaucracy and a military structure that they hope will last beyond the war.

Turkey has threatened to invade northern Syria to attack the YPG, which it considers a terror organisation. The presence of some 2,000 US troops in the country, in support of the Kurdish fighters, has held off Turkish action until now. But with Trump’s announcement that US forces will soon withdraw, the possibility of Turkey crossing the border has risen.

There is also the threat of Damascus. In recent weeks, Kurdish officials have stepped up talks with the Syrian government over a post-war agreement that would allow them to retain some form of autonomy, while allowing for the return of government forces to the area. But few fully trust the regime of Bashar al-Assad, and many wonder whether they will be forced to defend their gains against him, too.

For now, though, even though the battle is not yet done, many of the fighters here are thinking of home.