Libya's deputy parliamentary speaker has rejected the election of the country's new prime minister, in the latest political struggle to strike the North African country.
Hours after Ahmed Maetig was sworn in, the first deputy speaker Ezzedin al-Awami declared the vote invalid, as a power struggle erupted in the assembly.
Awami declared the vote invalid and instructed Abdullah al-Thinni, who had resigned three weeks ago, to continue ruling the major oil producer, according to the Reuters news agency.
"Mr Ahmed Omar Maetig failed to reach the quorum of 120 votes necessary according to the law to elect a new prime minister," -Awami wrote in a letter to al-Thinni posted on the cabinet website.
After a chaotic session of parliament, Maetig was initially reported to have mustered 113 votes of the 120 needed under the constitution in a vote of confidence.
But the second deputy of parliament, Saleh al-Makhzoun said Maetig had in fact clinched 121 votes, apparently after a recount, defeating challenger Omar al-Hassi, a university professor.
"Ahmed Maetig is officially the new prime minister," al-Makhzoun said as some politicians immediately challenged Maetig's appointment by shouting.
Al-Sharif al-Wafi, an independent politician from Benghazi, told the Associated Press news agency the swearing-in was unconstitutional and defied democratic principles.
The second deputy of parliament continued the session after the first deputy had adjourned the session following the vote and ensuing chaos, Al-Wafi said.
Fatma al-Majbari, an MP, told Libyan TV station Al-Ahrar there were no violations in the session and that new votes came after the session was adjourned.
Libya's 185-seat interim parliament has been deadlocked and unable to impose authority after Thinni resigned as prime minister three weeks ago, citing an attack by gunmen on his family.
Thinni resigned just one month after his election, when he replaced Ali Zeidan who was voted out of office after rebels humiliated the government by shipping crude on a tanker without government permission. The tanker was ultimately seized by US forces and returned to the country.
Libya has seen a severe deterioration in security since the end of Muammar Gaddafi's decades-long rule in 2011.