Libya has a new prime minister. But in keeping with months of chaos in the North African nation, the events leading up to Sunday's swearing-in were confusing and turbulent.
Ahmed Matiq, an Islamist-leaning businessman from the economically important western city of Misrata, took the oath of office in a televised ceremony. But the balloting by lawmakers that preceded his inauguration was murky.
Secularists walked out of the proceedings, and a vote televised by the state broadcaster initially indicated Matiq had not received sufficient support. But a reconvened session and a new tally with one vote more than the 120 votes he needed was announced by the state news agency LANA.
Addressing lawmakers, Matiq thanked them for the vote of confidence. His main rival had been a more rigorous Islamist.
Even carrying out a vote was something of a triumph for Libya's beleaguered government. Last week, the balloting was put off after armed men tried to overrun the parliament, triggering a firefight. Security has generally deteriorated in the capital, Tripoli, in recent months, with armed factions often overrunning government installations.
The previous Western-backed prime minister, Ali Zidan, left Libya this year after parliament forced him out with a no-confidence vote. That came on the heels of a crisis during which rebels in eastern Libya seized millions of dollars worth of crude oil and tried to sell it on the black market via an illicit tanker shipment.
The vessel was intercepted by U.S. Navy SEALs and brought back to a government-controlled port.
Late last year, armed militiamen kidnapped Zidan from the luxury hotel that had been his home base, leading him away in his pajamas. Zidan's defense minister, Abdullah Thinni, took over temporarily as prime minister after Zidan's ouster by lawmakers, but declined to form a government.
The two years since longtime dictator Moammar Kadafi was overthrown with NATO's help and then killed have been strife-ridden, with many Libyans deeply disappointed by the outcome of a revolution that swiftly devolved into a civil war.
Internal splits and rivalries have rendered attempts at governance ineffective. Armed groups wield the greatest share of power, and the upheaval has made it almost impossible for Libya to monetize its energy riches.