Osama Swehli is bearded and wears his hair long, tied back in a thick ponytail. A soldier with the National Transitional Council’s fighters in the Libyan coastal city of Sirte, his English is fluent from his time living in west London.

Until the fall of Sirte – Muammar Gaddafi’s home city – Swehli was one of those who listened in to the radio frequencies of the pro-Gaddafi defenders of the besieged city.

Twelve days ago, the Observer encountered Swelhi at a mortar position in Sirte close to the city’s still contested television station at the edge of District Two where the Gaddafi loyalists would be trapped in a diminishing pocket. “We know some of the call signs of those inside,” Swehli explained, as men around him fired mortars into the areas still under Gaddafi control.

“We know that call sign ‘1’ refers to Mo’atissim Gaddafi and that ‘3’ refers to Mansour Dhao, who is commanding the defences. We have an inkling too about someone known as ‘2’, who we have not heard from for a while and who has either escaped or been killed.” That person, he believed, was Abdullah Senussi, Muammar Gaddafi’s intelligence chief.

“There is someone important in there, too,” Swelhi said, almost as an afterthought. “We have heard several times about something called ‘the asset’ which has been moved around the city.” Precisely who and what “the asset” was now is clear, even if most government fighters in and around the city could not believe it at the time. They were convinced that Libya’s former leader was in all likelihood hiding in the Sahara desert. But the asset was Gaddafi himself, who would die in the city, humiliated and bloody, begging his captors not to shoot him.

Already the last minutes in Gaddafi’s life have gained a grisly status. A spectacle of pain and humiliation, the end of the man who once styled himself the “king of the kings of Africa” has been told in snatches of mobile phone footage and blurry stills and contradictory statements. It is the longest of these fragments of a death – a jerky three minutes and more shot by fighter Ali Algadi on his iPhone and acquired by a website, the Global Post – that describes those moments in the most detail. A dazed and confused Gaddafi is led from the drain where he was captured, bleeding heavily from a deep wound on the left side of his head, from his arm, and, apparently, from other injuries to his neck and torso, staining his tunic red with blood. He is next seen on the ground, surrounded by men with weapons shouting “God is great” and firing in the air, before being lifted on to a pickup truck as men around him shout that the ruler for more than four decades should be “kept alive”.

There are other clips that complete much of the story: Gaddafi slumped on a pickup truck, face smeared with blood, apparently unconscious; Gaddafi shirtless and bloody on the ground surrounded by a mob; Gaddafi dead in the back of an ambulance. What is not there is the moment of his death – and how it happened – amid claims that he was killed by fighters with a shot to the head or stomach. By Friday, the day after he died, the body of the former dictator once so feared by his Libyan opponents was facing a final indignity – being stored on the floor of a room-sized freezer in Misrata usually used by restaurants and shops to keep perishable goods.

If there is an irony surrounding the death of Muammar Gaddafi, it is, perhaps, that he should have met his end in Sirte, a city more than any other associated with his rule. Gaddafi was not born in the city itself but in Bou Hadi, a sprawling, largely rural area of farms and large villas on the city’s outskirts.

It was Sirte that Gaddafi turned into his second capital – a former fishing village that he transformed into a place dedicated to both his own ego and his Third Revolutionary Theory, which he embodied in his Green Book that was taught in all Libyan schools. It was here, too, that the nomenklatura of Gaddafi’s regime had their second homes, sprawling villas in roads lined by eucalyptus trees, beside well-tended parks or overlooking the Mediterranean. And as the city fell, bit by bit over the weeks, its nature was revealed.

Abandoned houses reveal evidence of a city’s dedication to the Gaddafi cult. The Observer found a discarded mobile phone belonging, it seems clear, to a friend of Mo’atissim Gaddafi with pictures of parked white stretch limousines. There are pictures in the wealthier houses of Gaddafi with their occupants and stylised beaten copper images of Gaddafi on the walls. In one building, discovered by paramedics with the government forces, there is a trove of snapshots of Gaddafi and his sons. No wonder, perhaps, that this is where he chose to make his last stand.

The conflict around the city – during the long siege that began in September – reveals another nature of Sirte that must have made it attractive to Gaddafi. There are concrete walls within walls, compounds within those barriers, easy for Gaddafi and his protectors to defend. For those attacking Sirte they seemed for a while to be insuperable obstacles, not least the long barrier blocking access to the vast plaza of the Ouagoudougou conference centre.

During the weeks of the siege, life on the Gaddafi side of the lines in Sirte was thrown up in fragments, as disjointed as the last moments of Gaddafi’s life. There were small counter-attacks as the government forces crept forward, sometimes with rocket-propelled grenades that burst in the air or crashed into buildings. At other times machine-gun fire rattled into the bullet-pocked facades of offices, banks, schools or villas. But it was at night that Gaddafi’s forces were most active. They probed for weak positions. There were rumours of cars attempting to break out as the net closed.

Twice the Observer heard accounts of sightings of a car belonging to Mo’atissim Gaddafi. And with each day fighters posed the same question to which they could not supply an answer: why was it that those fighting on the Gaddafi side would not give up?

It is only now, after Gaddafi’s death, that any sketchy details of how he lived on the run have begun to emerge and, indeed, who was ultimately responsible for his safety. How Gaddafi came to be in Sirte – if not the reason that he went to one of the few locations still strongly supportive of him – remains murky. It is believed he fled from Tripoli shortly before it fell in August.

Motorcades carrying his wife and daughter to Algeria, and at least one other son to Niger, were spotted and the details leaked to the media by Nato. But the convoy carrying the dictator appears to have been missed. For his escape, Gaddafi had only one highway to travel – leading south of the capital to Beni Walid, 90 miles from Tripoli, the only highway not in rebel hands. A further detour would then have been necessary to avoid the rebels who were pushing in all directions out of the coastal city of Misrata, involving the convoy driving south-east, deeper into the Libyan desert, to the only traffic junction leading to Sirte at Waddan. This city, which fell to the rebels last month, was under 24-hour surveillance, according to the Pentagon, with drones keeping a close eye on the chemical weapons store five miles north of the city – home to Libya’s remaining stockpile of nine tonnes of mustard gas.

The rebels were deeply divided over where Gaddafi was. Some believed he had fled on one of the convoys carrying his wife and other sons that were spotted crossing south to Niger and east to Algeria. Misrata’s Shaheed brigade set up a special unit, suspecting that Gaddafi had been trapped in the capital by the speed of the rebel advance and for the last two months they have been carrying out raids in Tripoli hoping to find him.Still others thought he had driven to the fabled Bunker, a possibly mythical concrete complex constructed deep in the desert by the dictator for such an emergency. They were all wrong.

The truth of Gaddafi’s last movements has now been revealed by one of his inner circle who travelled with him on his last convoy: Mansour Dhao – number “3” in the pro-Gaddafi radio codes – a former commander of Libya’s Revolutionary Guards. And like Gaddafi, Dhao was not supposed to be in Sirte. Instead, it was widely reported that Dhao had fled Libya in a convoy of cars heading for Niger. But as the weeks of the siege of Sirte went on, it became clear this was not true. Even as it was revealed that Gaddafi and his fourth son Mo’atissim were dead, Peter Bouckaert, emergencies director of Human Rights Watch, stumbled across an injured Dhao in hospital, who confirmed he had been in the same convoy with Gaddafi when the former Libyan leader had been captured and his son killed.

A day later Dhao was interviewed by a television crew. What Dhao had to say contradicted not only some previous understanding of who was conducting the war on Gaddafi’s behalf but supplied the first description of how events had unfolded on Gaddafi’s last day. While it was believed that Gaddafi’s son Khamis had directed the regime’s attempts to put down the rebellion against it, Dhao insisted that it was Mo’atissim. Not only that, Mo’atissim took control of his father’s safety, making all the key decisions until the end. “He was in charge of everything,” said Dhao. His face heavily bruised, Dhao insisted it was Mo’atissim who organised each movement of Gaddafi as he was ferried between safe houses for the two months since the fall of Tripoli, moving location on average every four days before becoming trapped in Sirte, the monument that became his living mausoleum. Crucially, it has been Dhao who has provided the most compelling account yet offered of Gaddafi’s last day of life as he attempted to leave the last pocket in the shattered seaside District Two to reach the countryside beyond Sirte’s eastern boundary.

“Gaddafi did not run away, and he did not want to escape,” Dhao said. “We left the area where we were staying, to head towards Jarif, where he comes from. The rebels were surrounding the whole area, so we had heavy clashes with them and tried to escape towards Jarif and break out of the siege. After that the rebels surrounded us outside the area and prevented us from reaching the road to Jarif. They launched heavy raids on us which led to the destruction of the cars and the death of many individuals who were with us.

“After that we came out of the cars and split into several groups and we walked on foot, and I was with Gaddafi’s group that included Abu Bakr Yunis Jabr and his sons, and several volunteers and soldiers. I do not know what happened in the final moments, because I was unconscious after I was hit on my back.”

Some things do not ring true. According to Dhao, Gaddafi was moving from place to place and apartment to apartment until last week, but given the state of the siege of Sirte at that stage it seems unlikely that he could have entered the city from outside. The net was closing around the last loyalists who were squeezed into a pocket, surrounded on all sides, that was becoming ever smaller by the day.

Dhao made no mention either of the attack on the Gaddafi convoy by a US Predator drone and a French Rafale jet as it tried to break out of Sirte, attempting to drive three kilometres through hostile territory before it was scattered and brought to a halt by rebel fighters. It is possible that Dhao did not know that the first missiles to hit the Gaddafi convoy as it tried to flee came from the air.

What is clear is that at around 8am on Thursday, as National Transitional Council fighters launched a final assault to capture the last remaining buildings in Sirte, in an area about 700 metres square, the pro-Gaddafi forces had also readied a large convoy to break out.

But if Dhao was not aware of the air strike, then neither did Nato’s air controllers and liaison officers with the NTC fighters know that Gaddafi was in the convoy of 75 cars attempting to flee Sirte, a fact revealed in a lengthy statement on Friday.

“At the time of the strike,” a spokesman said, “Nato did not know that Gaddafi was in the convoy. These armed vehicles were leaving Sirte at high speed and were attempting to force their way around the outskirts of the city. The vehicles were carrying a substantial amount of weapons and ammunition, posing a significant threat to the local civilian population. The convoy was engaged by a Nato aircraft to reduce the threat.”

It was that air attack – which destroyed around a dozen cars – that dispersed the convoy into several groups, the largest numbering about 20. As NTC fighters descended on the fleeing groups of cars, some individuals jumped from their vehicles to escape on foot, among them Gaddafi and a group of guards. Finding a trail of blood, NTC fighters followed it to a sandy culvert with two storm drains. In one of these Gaddafi was hiding.

Accounts here differ. According to some fighters quoted after the event, he begged his captors not to shoot. Others say he asked of one: “What did I do to you?” But it is what happened next that is the source of controversy.

What is certain from several of the clips of video footage – most telling that shot by Ali Algadi – is that Gaddafi was dazed but still alive, although possibly already fatally wounded. The question is what happens between this and later images of a lifeless Gaddafi lying on the ground having his shirt stripped off and propped in the back of a pickup truck and the next sequence which shows him dead.

Here the accounts differ wildly. According to one fighter, caught on camera, he was shot in the stomach with a 9mm pistol. According to doctors not present at his capture and ambulance staff, Gaddafi was shot in the head. Some NTC officials have said anonymously he was “killed after capture”, while others have said he was killed after capture in a crossfire.

If there are suspicions that Gaddafi was summarily killed, already raised by Amnesty and UN human rights officials, they have been deepened by the death, too, of his son Mo’atissim in even more dubious circumstances. He was filmed alive but wounded smoking a cigarette and drinking from a bottle of water, before the announcement that he also had died.

On Saturday, in the cold storage unit where Gaddafi’s body was being stored as the family demanded its release for burial, those filing in to film his corpse were less bothered about how he had died than the legacy of his 42-year rule. “There’s something in our hearts we want to get out,” Abdullah al-Suweisi, 30, told Reuters as he waited. “It is the injustice of 40 years. There is hatred inside. We want to see him.”

And in confirming that Gaddafi is no more, the Libyan people want to bring the final curtain down on his tyranny.