BENGHAZI Libya (Reuters) - Libya's parliament reappointed Prime Minister Abdullah al-Thinni on Monday as the government lost control of ministries in the capital where armed groups have taken over and a separate parliament has claimed legitimacy.
In another sign of the oil producer sliding deeper into anarchy, Islamist militants launched a new attempt to seize Benghazi's civilian and military airport from army forces allied to a renegade general. At least 13 soldiers from Haftar's forces were killed and 45 wounded, medics said.
The parliament that was elected in June moved to the remote eastern city of Tobruk last month as rival armed groups battled for Tripoli. An alliance led by forces from the western city of Misrata seized control of the capital last week.
The reappointment of Thinni, a former defense minister and career soldier who has been prime minister since March, sets him the challenge of reasserting government control over a country where many fear a descent into full-scale civil war.
Parliamentary spokesman Faraj Hashem said 64 of the 106 representatives present had voted for Thinni and the house had instructed him "to form a crisis government within a period of time not exceeding two weeks".
U.S. Foreign Minister John Kerry called Thinni before his appointment to give his support, the Libyan government said in a statement. Both stressed the need for national dialogue and reconciliation, it added.
In a stark illustration of the government's loss of control in Tripoli, a video posted online showed dozens of men, some armed, crowding around a swimming pool at an U.S. embassy building, with some diving in from a nearby building.
Washington said on Sunday that an armed group had taken over an abandoned annex of the U.S. Embassy but had not broken into the main compound. All embassy staff were evacuated last month.
Late on Sunday, the government released a statement admitting it had lost its grip on many levers of power.
"We announce that most ministries, institutions and state bodies in the capital Tripoli are out of our control," it said, adding that armed groups had prevented staff entering some government buildings.
All ministries, the central bank and the state-owned National Oil Corp are located in the capital.
The victory of Misrata forces in Tripoli has not yet affected oil production; but traders say ownership of the oil might be subject to legal challenges if those forces take control of the central bank, where crude revenues are booked.
The groups now controlling Tripoli, some of which have Islamist leanings, refuse to recognize the parliament in Tobruk, which has a strong liberal and federalist presence.
They have reconvened the previous parliament, the General National Congress, in which Islamists were strongly represented.
The government said in a statement that armed factions had attacked a Tripoli camp for internally displaced people from the western town of Tawergha.
It did not name the attackers. The Misrata factions accuse the Tawergha people of having backed Libya's former dictator, Muammar Gaddafi, who was deposed in a NATO-backed uprising in 2011.
The fluid situation in Tripoli has been exacerbated by separate clashes in the eastern port city of Benghazi where Khalifa Haftar, a renegade general from the Libyan army, has declared war on Islamist militants.
On Monday, loud explosions and war planes could be heard from the area of the closed airport which Islamist forces have been trying to seize from Haftar's forces allied to the regular army.
The area is one of the last positions of army special forces after Islamists overran several camps. Residents said the Islamists including Ansar al-Sharia were trying to enter the Benina area home to the airport and airbase. A nearby soccer stadium was also hit.
Writing by Ulf Laessing; Editing by Ralph Boulton