Libyans celebrated on Friday the first anniversary of the uprising that ousted Moamer Kadhafi with fireworks and slogans, even as their new leader vowed to prevent further instability.
Thousands gathered in Tahrir (Liberation) Square in Benghazi, the city which first rose against Kadhafi and his 42-year regime, after traditional Muslim prayers, waving Libya's new flag and proclaiming the revolution's "birthday."
Thousands more gathered in the capital's Martyrs' Square, as jubilant as their fellow countrymen hundreds of kilometres (miles) to the east.
"It's the first time in 40 years that I have a crowd like this turn out spontaneously," said Ali, a 55-year-old security officer, as he surveyed the Tripoli crowds from the top of a tower block overlooking the square.
"Before, under Kadhafi, everything was organised and planned. We lost our spontaneity. I thank God that I have lived to see this day."
Official celebrations were not organised at a national level out of respect for the thousands of people killed in the conflict that saw Kadhafi captured and slain on October 20.
But spontaneous commemorations began around the country, as former rebels, who toppled Kadhafi last year with NATO backing, set up fresh checkpoints in Tripoli, Benghazi, the western port city of Misrata and other towns.
In Benghazi's Tahrir Square, mothers held pictures of their sons killed in the fighting, while singers and poets performed for the crowds.
Nearly everyone wore the red, black and green colours of the new Libya.
A Libyan flag said to be 17 kilometres (10.5 miles) long and about three metres (nine feet) wide was carried along the corniche to the square. It was impossible to verify the length, but the banner stretched off into the distance and out of sight.
"This is the first birthday of Libya. It is a day of freedom, a day to remember. The days ahead will be better now that Kadhafi is gone," said Malek L Sahad, a Libyan-American rap singer who returned to his native country last year.
University student Amal Feturi, 19, was dancing with friends among hundreds of women.
"Until now we were like birds in a cage, but with Moamer's death the cage is broken, and we are free."
Interim Prime Minister Abdel Rahim al-Kib paid tribute to Benghazi's role as birthplace of the uprising in an address to the crowd.
Signup to our newsletter and follow us on Facebook and Twitter!
"From this special place which is the Tahrir Square, we commit to look after the families of the martyrs and to those who are injured, and to fight and chase all the remnants of Kadhafi inside and outside of Libya," Kib said.
"Benghazi, you are the heroes. Allahu Akbar (God is greatest."
Thuwar, or revolutionaries, were deployed across the city to ensure the celebrations went peacefully, and Libyan ruler Mustafa Abdel Jalil warned on Thursday that the nation's revolutionary spirit and stability would not be compromised.
"We opened our arms to all Libyans, whether they supported the revolution or not. But this tolerance does not mean we are incapable of dealing with the stability of our country," he said in a television address.
Tripoli resident Naima Misrati said traffic police and former rebels were distributing leaflets, warning people against thinking of carrying out attacks, which said: "We cannot bring back the buried man (Kadhafi) but we can send you to him."
The pro-Kadhafi Libyan Popular National Movement posted a statement on several websites saying the situation in Libya "is becoming worse every day."
"There's very little interest from the international media in the many horrors that have taken place. We are reorganising ourselves outside Libya in an inclusive political movement that would encompass all Libyans who understand the terrible reality of Libya," it said.
One year after the uprising, Libya is battling challenges ranging from how to tame the rowdy militias that fought Kadhafi to establishing a new rule of law.
Thousands of people were killed or wounded in the conflict, the country's vital oil production ground to a halt, and homes, businesses, factories, schools and hospitals were devastated.
But the most immediate headache is how to control the tens of thousands of ex-rebels who have now turned into powerful militias, whose jealously guarded commitment to their honour and power occasionally erupts into deadly clashes.
Global human rights organisations Amnesty International, Human Rights Watch and Doctors Without Borders have accused militias of torturing their prisoners, most of whom are former pro-Kadhafi fighters.
UN Secretary General Ban Ki-moon on Friday urged "all Libyans to stand together in a spirit of reconciliation."
"A revolution in the name of human rights must not be tarnished by abuses but must bring about justice through rule of law," Ban said.
The White House called on Libya's rulers to protect the freedoms and rights of the country's citizens.
"Protecting the rights of all the Libyan people will help preserve the unity of purpose that defined the revolution," spokesman Jay Carney said, while also encouraging ex-rebels to work with the government "to establish stability, peace, and reconciliation."