Fresh details have emerged of the coup attempt against Isis leader Abu Bakr al-Baghdadi, with witnesses claiming foreign members of the terror group lost a two-day battle with his bodyguards before being rounded up and executed.

A witness who spoke to the Guardian after being smuggled from the last hamlet in eastern Syria held by Isis, said the clash took place in al Keshma, a village next to Baghouz in September, three months earlier than regional intelligence officials believed it had taken place.

“I saw him with my own eyes,” said Jumah Hamdi Hamdan, 53. “He was in Keshma and in September the Khawarij (infidels) tried to capture him.

“The fighting was very intense, they had tunnels between houses. They were mainly Tunisians and there were many people killed.”

Destroyed building on the outskirts of Baghouz,10 February 2019.

Hamdan said Baghdadi then moved to Baghouz, from where he fled to the desert in early January. This account was supported by senior regional officials, who say he probably remains there, as the remnants of the so-called caliphate he built disintegrates nearby.

A senior military official from the Syrian Democratic Forces (SDF), the Kurdish-led force battling Isis, said other members of Isis’ foreign legion had joined the fight, including Algerians and Moroccans. “It was a really tough clash and they excommunicated the losers,” said an SDF commander at the Baghouz frontline, who uses the nom de guerre Adnan Afrini. “It started in mid-September and it was a very serious attempt to kill or capture him. We don’t think he is in the town now.”

Hamdan said Baghdadi and his guard force had been in the area for almost six months before fleeing. “He tried to keep a low profile and didn’t travel through town with them but we all knew where they were. He used an old red Opal car.”

Abu Bakr al-Baghdadi is said to have survived the attack in September. Photograph: -/AFP/Getty Images

Isis has placed a bounty on the head of the main plotter, Abu Muath al-Jazairi, who is believed to be a veteran foreign fighter.

Nemsha, along with much of Baghouz, stands in ruin as Kurdish forces and special forces from Britain, France and the US tighten the net on the last pocket the group holds – a small strip of land along the Euphrates river.

Kurdish forces on the Baghouz frontline estimate the area is defended by about 400 hardcore Isis members, who do not intend to surrender. The SDF said it had captured 41 positions held by Isis.

Isis leaders are believed to be holding western hostages who were captured by the organisation over the past five years and whom they intend to use as bargaining chips. British journalist John Cantlie is believed to be among them and Baghouz residents who have fled the town suggested caves on the outskirts were being used to hide him and other captives.

Aram Kochar, a fighter with the Syrian Democratic Forces (SDF) on the outskirts of Baghouz during a lull in fighting to retake it from Isis.

Mortars fired by western special forces rained down on the holdouts through much of Sunday. Fighter jets soared above, leaving circular white streams that marked their orbits. The planes occasionally dropped powerful bombs that created huge plumes of smoke. Surveillance drones moved slowly beneath the jets. Aram Kochar, a Kurdish military official said Isis fighters were wary of the drones and were rarely seen on the streets, apart from at dusk or under cloud cover.

“They’re very committed and they don’t plan on leaving,” the official said from the rooftop of a forward base, about 700 metres from the nearest Isis position. “We took two houses yesterday and they took them back from us at night.”

On Saturday night, Kurdish forces launched the final phase of the operation to take Baghouz – a move that will allow them to lay claim to ousting Isis from all the Syrian lands it had held since capturing a swathe of the country in early 2013. During the peak of its powers, Isis had made the nearby border with Iraq redundant and controlled an area of land from eastern Aleppo to Mosul – roughly the size of Wales.

Members of the Syrian Democratic Forces (SDF) seen on the rooftop of a building on the outskirts of Baghouz.

As its losses pile up, the group faces a return to the ways of its forerunners, a low-level insurgency that terrorised Iraqi towns and cities, in particular. On Friday night, up to 10 Isis fighters on motorbikes attempted to storm a US military base near the al-Omar oilfield, 60km (37 miles) from the frontline. The attack was heralded earlier on Friday when a motorbike detonated on a bridge near the base.

Afrini said Isis knew guerrilla warfare well and that combatting the group when its members slipped back into their communities would pose a significant challenge. “That will require an intelligence war at the local level,” he said. “It’s not going to be easy.”

Groups of people, believed to be the last to leave Baghouz, sat on a grass ridge just outside the town on Sunday, where new arrivals have been processed every day over the past three weeks. Bombs thudded into the nearby town as a chill wind buffeted black-clad women and children milling slowly near military trucks that had staged for the fight.

Abandoned motorbikes, tattered clothes and razors littered an approach road. Inside Baghouz, bombed-out oil tankers lay scattered among rows of shattered houses. “This might take a week or so,” said Kochar. “Maybe more.”

Additional reporting: Mohammed Rasool