Libya prime minister
Libya's internationally recognized Prime Minister Abdullah al-Thinni speaks during an interview with Reuters in Bayda February 15, 2015. REUTERS/Esam Omran Al-Fetori

(Reuters) - Libya's internationally recognized prime minister, Abdullah al-Thinni, said on Tuesday he had survived an assassination attempt after leaving a session of the anarchic country's elected parliament.

The incident highlighted the unravelling of state authority in the North African country in which two governments and parliaments allied to armed factions are fighting for control four years after rebels overthrew Muammar Gaddafi.

Thinni has faced increasing criticism for running an ineffective rump state in the east since losing the capital Tripoli in the west to a rival faction that now controls ministries and key state bodies based there.

Thinni told pan-Arab news channel al-Arabiya that after he left parliament in the town of Tobruk and drove off, gunmen in several cars followed his entourage and opened fire.

"We were surprised by a lot of bullets... Thank God, we managed to escape," Thinni said. He did not elaborate.

Parliament speaker Aqila Saleh had asked Thinni to leave the assembly for his safety after protesters opposed to his government gathered outside the naval base where the parliament meets, two lawmakers told Reuters.

A burning car could be seen outside the gated venue, lawmakers said. The session resumed after Thinni's departure. Thinni works out of Bayda, near Tobruk to the west.

It was the latest disruption in a tumultuous year for the House of Representatives, which has like Thinni struggled to stamp its authority over an increasingly fragmented country.

Thinni's government had originally planned to set up parliament in the main eastern city of Benghazi but relocated to Tobruk near the Egyptian border after Benghazi turned into a battleground between the government and Islamist militants.

Parliament initially opened in a Tobruk hotel but moved to the naval base after a suicide bomber detonated a car in front of the hotel in December.

The House of Representatives is being challenged by a Tripoli-based assembly known as General National Congress set up after a rival faction seized the capital in August.