Jubilant Libyans have voted for a new parliament in their first nationwide vote in decades.
Violence and protests in the restive east have underlined the challenges ahead as the oil-rich North African nation struggles to restore stability after the removal and death of long-time dictator Muammar Gaddafi.
One person was killed and two wounded in a gun battle between security forces and anti-election protesters in the eastern city of Ajdabiya, according to the head of the election commission.
Nouri al-Abari said the polling centre targeted by the protesters was later reopened and voting commenced normally.
The shooting followed a spate of attacks on polling centres in the eastern half of the country, which was the cradle of the revolution against Gaddafi but has become increasingly unsettled over the perceived domination of power by rivals in Tripoli.
The vote capped a chaotic transition that has exposed major fault lines ranging from the east-west divide to efforts by Islamists to assert power.
Lines formed outside polling centres more than an hour before they opened in the capital Tripoli, with policemen and soldiers standing guard and searching voters and election workers before they entered.
"I have a strange but beautiful feeling today," dentist Adam Thabet said as he waited his turn to cast a ballot. "We are free at last after years of fear. We knew this day would come, but we were afraid it would take a lot longer."
The election for a 200-seat parliament, which will be tasked with forming a new government, was a key milestone after a bitter civil war that ended Gaddafi's four-decade rule. It was the first time Libyans have voted for a parliament since 1964, five years before Gaddafi's military coup that toppled the monarchy.
But the desert nation of six million people has fallen into turmoil since Gaddafi was killed by rebel forces in his home city of Sirte in late October. Armed militias operate independently, refusing to be brought under the umbrella of a national army, and deepening regional and tribal divisions erupt into violence with alarming frequency. Growing resentment in the east and the inability to rein in militias have threatened to tear the country apart.