Gunmen have stormed Libya's parliament in Tripoli as MPs were preparing to elect a new prime minister.

According to early reports several people were injured in the attack.

"Armed men have besieged the congress, but we do not know the motive of the attack," MP Tahar Mokni told AFP.

"We suspended proceedings, and the vote has been postponed until next week."

Two MPs were wounded in a similar incident in March, when a mob of armed protesters raided the General National Congress building.

The latest storming came as parliamentarians sat down for a special session to select a new prime minister after Ali Zidan was ousted by a vote of no confidence. His interim successor, Abdullah al-Thinni, stepped down a few weeks after taking up office when he and his family were targeted by militiamen.

The two candidates to replace Thinni are Ahmed Matiq, a 42-year-old businessman from Misurata, and Omar al-Hassi, a political science professor from Benghazi

Hassi is backed by the hardline Islamist bloc while Matiq is supported by independents.

Libya has been in turmoil ever since the removal of Muammar Gaddafi from power two years ago.

The fragile central government has been struggling to rule a country fragmented by conflicting tribal loyalties and has depended on unruly militias to fill the security vacuum left by the revolution.