SIRTE, Libya - Muammar Gadhafi was killed by Libyan fighters he once scorned as "rats", cornered, beaten and then shot in the head after his chaotic capture by fighters who overran his last redoubt on Thursday in his hometown of Sirte.
Two months after Western-backed rebels ended 42 years of Gadhafi's rule by capturing the capital Tripoli, his death and the fall of the final bastion ended a nervous hiatus for the new interim government, which is now set to declare formal "liberation" with a timetable for elections.
But confusion over Gadhafi's death was a reminder of the challenge for Libyans to now summon order out of the armed chaos that is the legacy of eight months of grinding conflict.
The killing or capture of senior aides, including possibly two sons, as an armoured convoy braved NATO air strikes in a desperate bid to break out of Sirte, may ease fears of diehards regrouping elsewhere - though cellphone video, apparently of Gadhafi alive and being beaten, may inflame his sympathisers.
Libyan Prime Minister Mahmoud Jibril, reading what he said was a post-mortem report, said Gadhafi was unhauled unresisting from a "sewage pipe". He was then shot in the arm - it was not clear by whom - and then put in a truck which was "caught in crossfire" as it ferried the 69-year-old to hospital.
"He was hit by a bullet in the head," Jibril said, adding it was unclear which side had fired the fatal shot.
The body, bloodied, half naked, Gadhafi's trademark long curls hanging limp around a rarely seen bald spot, was delivered, a prize of war, to Misrata, the city west of Sirte whose siege and months of suffering at the hands of Gadhafi's artillery and sniper made it a symbol of the rebel cause.
A quick, secret burial was planned, officials said.
"It's time to start a new Libya, a united Libya," Jibril declared. "One people, one future." A formal announcement of liberation, which will set the clock ticking on a timeline to elections, would be made on Saturday, Libyan officials said.
French President Nicolas Sarkozy, who spearheaded a Franco-British move in NATO to back the revolt against Gadhafi hailed a turn of events that few had expected so soon, since there had been little evidence that Gadhafi himself was in Sirte.
But he also alluded to fears that, without the glue of hatred for Gadhafi, the new Libya could descend, like Saddam Hussein's Iraq, into bloody factionalism: "The liberation of Sirte must signal ... the start of a process ... to establish a democratic system in which all groups in the country have their place and where fundamental freedoms are guaranteed," he said.
NATO, keen to portray the victory as that of the Libyans themselves, said it would wind down its military mission.
Shot in head
The circumstances of the death of Gadhafi, who had vowed to go down fighting, remained obscure. Jerky video showed a man with Gadhafi's distinctive long, curly hair, bloodied and staggering under blows from armed men, apparently NTC fighters.
The brief footage showed him being hauled by his hair from the hood of a truck. To the shouts of someone saying "Keep him alive", he disappears from view and gunshots are heard.
"While he was being taken away, they beat him and then they killed him," a senior source in the NTC said before Jibril spoke of crossfire. "He might have been resisting."
Officials said Gadhafi's son Mo'tassim, also seen bleeding but alive in a video, had also died. Another son, heir-apparent Saif al-Islam, was variously reported to be surrounded, captured or killed as conflicting accounts of the day's events crackled around networks of NTC fighters rejoicing in Sirte.
In Benghazi, thousands took to the streets, loosing off weapons and dancing under the old tricolour flag revived by Gadhafi's opponents.
Mansour el Ferjani, 49, a Benghazi bank clerk and father of five posed his 9-year-old son for a photograph holding a Kalashnikov rifle: "Don't think I will give this gun to my son," he said. "Now that the war is over we must give up our weapons and the children must go to school.
In Sirte fighters whooped with delight and brandished a golden pistol they said they had taken from Gadhafi.
Accounts were hazy of his final hours, as befitted a man who retained an aura of mystery in the desert down the decades as he first tormented "colonial" Western powers by sponsoring militant bomb-makers from the IRA to the PLO and then embraced the likes of Tony Blair and Silvio Berlusconi in return for investment in Libya's extensive oil and gas fields.
There was no shortage of fighters willing to claim they saw Gadhafi, who long vowed to die in battle, cringeing below ground, like Saddam eight years ago, and pleading for his life.
One description, pieced together from various sources, suggests Gadhafi tried to break out of his final redoubt at dawn in a convoy of vehicles after weeks of dogged resistance.
However, he was stopped by a French air strike and captured, possibly some hours later, after gun battles with NTC fighters who found him hiding in a drainage culvert.
NATO said its warplanes fired on a convoy near Sirte about 8:30 am (0630 GMT), striking two military vehicles in the group, but could not confirm that Gadhafi had been a passenger. France later said its jets had halted the convoy, which was comprised of some 80 vehicles.
Libyan television carried video of two drainage pipes, about a metre across, where it said fighters had cornered Gadhafi.
After February's uprising in the long discontented east of the country around Benghazi - inspired by the Arab Spring movements that overthrew the leaders of neighbouring Tunisia and Egypt - the revolt against Gadhafi ground slowly across the country before a dramatic turn saw Tripoli fall in August.
An announcement of "liberation" - the signal for the start of a transition to elections - was expected on Saturday. The eight weeks since the fall of Tripoli have tested the nerves of the motley alliance of anti-Gadhafi forces and their Western and Arab backers, who had begun to question the ability of the NTC forces to root out diehard Gadhafi loyalists in Sirte and a couple of other towns.
Gadhafi, wanted by the International Criminal Court on charges of ordering the killing of civilians, was toppled by rebel forces on August 23, a week short of the 42nd anniversary of the military coup which brought him to power in 1969.
By averting a possible dispute in Libya and internationally about where to try him, and denying him a final platform for his trademark lengthy speeches, the summary killing on a desert road may have been helpful for Libyans, some analysts said.
Hundreds of NTC troops had surrounded the Mediterranean coastal town of Sirte for weeks in a chaotic struggle that killed and wounded scores of the besieging forces and an unknown number of defenders. One NTC official on Thursday recalled an estimate that some 40,000 have died this year.
"There is now this massive expectation. Up to now they've had an excuse that they are running a war. They don't have that now ... Everything now has got to happen," John Hamilton, a Libya expert at Cross Border Information, told Reuters.
"That's a hard task. They have to deliver for the people ... On the other hand, this may renew the honeymoon they enjoyed when Tripoli fell."
Some fear instability may linger and unsettle that process.
"Gadhafi is now a martyr and thus can become the rallying point for irredentist or tribal violence - perhaps not in the immediate future but in the medium-to-long term," said George Joffe, a north Africa expert at Cambridge University.
"The fact that NATO can be blamed for his death is worrying, in terms of regional support, and may undermine the legitimacy of the National Transitional Council."
The death of Gadhafi is a setback to campaigners seeking the full truth about the 1988 bombing over Lockerbie in Scotland of Pan Am flight 103 which claimed 270 lives, mainly Americans, and for which one of Gadhafi's agents was convicted.
Jim Swire, the father of one of the Lockerbie victims, said: "There is much still to be resolved and we may now have lost an opportunity for getting nearer the truth."