Libya's elected parliament, the House of Representatives, asked Abdullah al-Thinni on Monday to form a new government for the oil-producing country, a parliamentary spokesman said.
Thinni, a former defense minister and career soldier, has been prime minister since March but his position has been challenged by a rival parliament that refuses to recognize the House of Representatives.
Libya is descending into anarchy as former rebels who helped topple Moammer Gadhafi in a NATO-backed uprising in 2011 have turned their guns on each other, seeking to set the country's political agenda and control its vast oil reserves.
“The House has reappointed Abdullah al-Thinni today as the prime minister, asking him to form a crisis government within a period of time not exceeding two weeks,” the spokesman said.
The interim government, led by al-Thinni, had resigned last week. Al-Thinni said he hoped a new government would be more inclusive.
The move came as the government said it had lost control of most ministries and state institutions located in Tripoli after rival armed groups took over the capital.
Moved parliament to Tobruk
Last month, senior officials and the elected parliament moved to the remote eastern city of Tobruk, 1,500 kilometers (more than 900 miles) from the capital, as an alliance of armed factions led by forces from the western city of Misrata expelled a rival group and took control of Tripoli.
All ministries, the central bank and the state-owned National Oil Corp (NOC) are located in the capital.
The continuing violence has not yet affected oil production, but traders have said ownership of the oil might be subject to legal challenges if the Misrata forces take control of the central bank, where crude revenues are booked.
The new forces controlling Tripoli, some of which have Islamist leanings, have refused to recognize the Tobruk House of Representatives, which has a strong liberal and federalist presence.
They have reconvened the previous parliament, the General National Congress, in which Islamists were strongly represented, and last week named pro-Islamist figure Omar al-Hassi to form a "salvation government."
Interim authorities have been steadily losing ground to the militias and the Dawn of Libya, a mainly Islamist alliance, which seized Tripoli airport on August 22 after weeks of fierce fighting with nationalist rivals.
On Sunday, Islamist militiamen moved into the U.S. embassy compound in Tripoli, which was evacuated in late July. Videos showed cheering men diving from an upstairs balcony into the facility's swimming pool.
Dawn of Libya members said they had gone in to secure the complex of several villas in southern Tripoli, not far from the airport, to prevent it from being looted.
U.S. Ambassador Deborah Jones, now posted in Malta, said on Twitter that there was no indication the U.S. complex had been damaged.
Some information for this report provided by Reuters and AFP.