Libya has started a week of massive celebrations to mark 40 years since the coup that brought Colonel Muammar Gaddafi to power.
Jets flew over Tripoli, ahead of a military parade featuring soldiers from many African countries.
Hundreds of performers showcased Libya's history in drama and music, which was followed by a fireworks show.
Several African and Arab leaders are attending the celebrations, but Western leaders have decided to stay away.
This follows a political storm over the release from a Scottish prison of Libyan Abdelbaset Ali al-Megrahi, the only man jailed for the Lockerbie bombing.
The BBC's David Willey in Tripoli says all eyes were on the Libyan leader, wearing a general's uniform as he sat on a reviewing platform next to Libya's top military brass.
Col Gaddafi was seated behind bullet-proof glass on a huge stage - a tent-like structure with cascading white cloth - two seats from Venezuelan President Hugo Chavez.
As the parade continued, an army band played while low-flying helicopters trailed banners bearing the portrait of Col Gaddafi, our correspondent adds.
As night fell, the heads of state were driven in golf carts across the street from the main square for a lavish banquet dinner by the sea.
A theatrical musical performance began later, in which 800 dancers and musicians depicted Libya's history over the past 5,000 years.
The fireworks display was launched from ships anchored off the Tripoli coast.
The celebrations are scheduled to last six days.
Col Gaddafi took power on 1 September, 1969, after a bloodless coup against the king.
A small group of military officers led by the then-unknown 27-year-old army officer staged a coup against King Idris, who was exiled to Egypt.
The new regime, headed by the Revolutionary Command Council, subsequently banned political parties.
For years, Libya was ostracised by Western democracies who accused it of fostering terrorism abroad and displaying nuclear ambitions.
But relations improved after Col Gaddafi renounced his pursuit of nuclear weapons in 2003.
Libya also paid hundreds of millions of dollars in compensation to victims of the Lockerbie bombing.
But the only convicted bomber, al-Megrahi, was freed by the Scottish authorities on 20 August after he had served eight years of a life sentence for the 1988 bombing of Pan Am flight 103, in which 270 people died.
His subsequent hero's welcome in Tripoli generated anger in the US and UK. The British government has also been forced to deny reports that his release was linked to an oil deal.
As Libya marks its anniversary, British authorities have published all correspondence with Scottish ministers over his release.