Libya's new rulers declared the country freed from Muammar Gaddafi's 42 years of one-man rule, saying the "Pharaoh of the times" was in history's garbage bin and a future of democracy and reconciliation beckoned.
But as thousands in Benghazi on Sunday heard the authorities announce "liberation", Gaddafi's rotting body, unburied and on public display in Misrata, was casting a shadow over the nation he once dominated.
Some fear National Transitional Council (NTC) chief Mustafa Abdel Jalil, a mild-mannered former justice minister, will find it hard to impose his will on his fractious revolutionary alliance, pointing to Misrata's insistence on displaying Gaddafi's body and that of his son Mo'tassim and to the lack of a clear account about how they met their end.
The lack of a clear plan for Gaddafi's burial suggests to some analysts that there is justification for fears of a descent into leaderless turmoil and armed infighting.
Some Muslims will be vexed that Gaddafi has not been given a rapid burial as demanded by Islam, although few Libyans share the outrage expressed by one of his exiled sons, Saadi, about the deaths of his father and brother Mo'tassim.
At the Benghazi celebrations there was no direct reference to what some outsiders see as Misrata's ghoulish display.
In a speech Jalil renewed an earlier promise to uphold Islamic law.
"All the martyrs, the civilians and the army had waited for this moment. But now they are in the best of places ... eternal heaven," he said, shaking hands with supporters.
There is international disquiet about increasingly graphic and disturbing images on the Internet of abuse of what appears to be Gaddafi following his capture and the fall of his hometown of Sirte on Thursday.
But the immediate reaction to Sunday's announcement in Libya was jubilation.
"We are the Libyans. We have shown you who we are Gaddafi, you Pharaoh of the times. You have fallen into the garbage bin of history," said lawyer Abdel Rahman el-Qeesy, who announced the creation of a new government portfolio to deal with victims of the conflict.
"We declare to the whole world that we have liberated our beloved country, with its cities, villages, hilltops, mountains, deserts and skies," said an official who opened the ceremony in Benghazi, the place where the uprising erupted in February and which has been the headquarters for the NTC.
Cheering crowds waved the tri-colour flag. UN Secretary-General Ban Ki-moon said the United Nations would help build a new Libya. US President Barack Obama welcomed the declaration of liberation.
The announcement of "liberation" sets a clock ticking on a plan for a new government and constitutional assembly leading to full democracy in 2013.
"We hope we will have an elected democratic government with broad participation," student Ali Abu Shufa said.
Gaddafi promoted tribalism to keep the country divided, he said. "But now Gaddafi is dead, all the tribes will be united."
Gaddafi, who had vowed to fight to the end, was found hiding in a drain after fleeing Sirte, the last bastion of his loyalists. He died in chaotic circumstances after video footage showed him bloodied and struggling at the hands of his captors.
With big oil and gas reserves, Libya has the potential to become very prosperous, but regional rivalries fostered by Gaddafi could erupt into yet more violence that would undermine the authority of Jalil's NTC.
In Misrata, people queueing for a chance to see Gaddafi's body saw no reason for a rapid burial, apparently heedless of concern in Tripoli about how the NTC is perceived overseas.
"We brought our children to see him today because this is a chance to see history," said a man who gave his name as Mohammed. "We want to see this arrogant person as a lifeless body. Let all the people see him."
The declaration of liberation is intended to set the clock ticking on a process to set up a multiparty democracy, a system Gaddafi railed against for most of his 42 years in power.
An autopsy has been performed, and a medical source told Reuters that Gaddafi's body had a bullet in the head and a bullet in the abdomen.
"There are multiple injuries. There is a bullet in the abdomen and in the brain," the medical source said.
The autopsy was carried out at a morgue in Misrata, about 200 km (130 miles) east of Tripoli.
The loosely disciplined militias that sprang up in each town to topple the dictator with the help of NATO air power are still armed. The places they represent will want a greater say in the future, particularly the second and third cities Benghazi and Misrata, which were starved of investment by Gaddafi.
It was fighters from Misrata who emerged from a lengthy and bloody siege to play a large part in taking Tripoli and later caught Gaddafi.
British Foreign Secretary (Minister) William Hague and NATO Secretary-General Anders Fogh Rasmussen issued separate calls for Libyans to avoid retribution and reprisals and seize a chance to build pluralism and the rule of law.
US Secretary of State Hillary Clinton, speaking on the NBC program "Meet the Press", said she would strongly support both a UN and an NTC investigation into Gaddafi's death.
"Stand for unity and reconciliation, make it absolutely clear that everyone who stood with the old regime, as long as they don't have blood on their hands should be safe and included in a new Libya," she said.
There is some unease abroad over what many believe was a summary execution of Gaddafi. UN Human Rights Commissioner Navi
Pillay has called for an investigation into the killing, but few Libyans share those concerns.
Gaddafi's surviving family, in exile, wants his body and that of Mo'tassim to be handed over to tribal kinsmen from Sirte. NTC officials said they were trying to arrange a secret resting place to avoid loyalist supporters making it a shrine. Misrata does not want his body under its soil.
Saadi Gaddafi's lawyer said he was "shocked and outraged by the vicious brutality which accompanied the murders of his father and brother.
"The contradictory statements issued by the NTC excusing these barbaric executions and the grotesque abuse of the corpses make it clear that no person affiliated with the former regime will receive a fair trial in Libya, nor will they receive justice for crimes committed against them," lawyer Nick Kaufman said in an email sent to Reuters.
Libyan leaders have approved a request to open an investigation into Saadi over the murder of a footballer in 2005.