(Reuters) - Businessman Ahmed Maiteeq was sworn in as Libya's new prime minister on Sunday after chaotic voting but parliament's deputy speaker hours later declared the vote invalid as a power struggle erupted in the assembly.
The divisions in the assembly showcase growing turmoil in the North African country where government and parliament are unable to assert authority in a country awash with arms and militias from the 2011 ouster of Muammar Gaddafi.
Officials gave contradicting versions of the parliamentary election outcome, with First Deputy Speaker Ezzedin al-Awami initially saying Maiteeq had failed to obtain the necessary quorum even through he emerged as frontrunner in prior votes.
However, second deputy speaker Saleh Makhzoun later said he had won the necessary support and asked him to form a new government within two weeks.
"Ahmed Maiteeq is officially the new prime minister," Makhzoun told a televised session interrupted by shouts from lawmakers challenging his win.
But hours later Awami declared the vote invalid and instructed Abdullah al-Thinni, who had resigned three weeks ago, to continue ruling the major oil producer.
"Mr. Ahmed Omar Maiteeq 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 Thinni posted on the cabinet website.
There was no immediate reaction from Maiteeq, Makhzoun and lawmakers who had supported the election of the businessman.
Analysts expect Maiteeq, if confirmed, to struggle to make headway as the government is unable to control militias who helped topple Gaddafi but now defy state authority.
Since the civil war that ended Gaddafi's one-man rule, Libya's nascent democracy has struggled, with its parliament paralyzed by rivalries and brigades of heavily-armed former rebels challenging the new state.
The premier's post became vacant after Thinni resigned, citing an attack by gunmen on his family just a month into his term.
Parliament began voting on his successor on Wednesday, but that session was postponed after gunmen linked to a defeated candidate stormed the building and wounded several people.
Lawmakers resumed voting on Sunday in a frequently interrupted session, marked by confusion over the number of votes cast for Maiteeq. Lawmakers were heavily divided over the legitimacy of his election.
"The vote ... to appoint him as the prime minister was totally invalid," said lawmaker Zainab Haroun Al-Targi.
Thinni's short-lived tenure followed that of Ali Zeidan who fled the country after he was fired by deputies over his failure to stop attempts by rebels in the volatile east to sell oil independently of Tripoli's government.
Libya's assembly is deadlocked between Islamists, tribes and nationalists, as the country's fledgling army tries to assert itself against unruly ex-rebels, tribal groups and Islamist militants.
In February, it agreed to hold early elections in an effort to assuage Libyans frustrated at political chaos nearly three years after the fall of Gaddafi.
Many people in the OPEC nation blame congressional infighting for a lack of progress in the transition to democracy. Libya still has no new constitution.
Assembly president Nouri Abu Sahmain was absent from the vote. He has disappeared from public view since the attorney general launched an investigation into a leaked video showing him being questioned over a late-night visit by two women to his house.