Libya's elected parliament, the House of Representatives, has asked Abdullah al-Thinni to form a new caretaker government, amid political division and ongoing violence in the country.
"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," a spokesman said on Monday.
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.
Last month, senior officials and the elected parliament moved to the remote eastern city of Tobruk as an alliance of armed factions led by forces from the western city of Misrata took control of Tripoli, having expelled a rival group.
All ministries, the central bank and the state-owned National Oil Corp (NOC) are located in the capital.
Thinni had been prime minister of the oil-rich country since March, but his position has been challenged by a rival parliament refusing to recognise the House of Representatives.
Last Thursday Thinni and his cabinet announced their resignation to make way for a new government based on parliamentary elections held in June.
A government statement said the interim government was in contact with officials and "trying to ensure the continuity of services from afar."
Interim authorities have been steadily losing ground to armed rebels and the Fajr Libya alliance, which has seized Tripoli airport after weeks of fierce fighting with nationalist rivals.
The House of Representatives replaced the General National Congress in June, but was forced to move to Tobruk in the far east of the country to escape a month of street fighting in the capital, Tripoli.
A rival body, the General National Congress, last week Omar al-Hassi to form a "salvation government".
Libya has been embroiled for weeks of political infighting and violence that has killed and wounded dozens on all sides.
The country has slid into chaos since Muammar Gaddafi was overthrown and killed three years ago, with interim authorities confronting powerful armed groups, which fought to oust the veteran dictator.
On Sunday, armed rebels moved into the US embassy compound in Tripoli that was evacuated in late July, with videos showing cheering men diving from an upstairs balcony into the facility's swimming pool.