Mohammed Megaryef, president of Libya's national assembly, has escaped an attack on his hotel in the southern oasis of Sabha in an incident his spokesman on Sunday called an assassination attempt.

"The hotel he was staying in was attacked for three hours. There was sniper fire. It seems to have been an assassination attempt," the assembly chief's spokesman, Rassmi Beruwien, told Agence France Presse of the incident that happened on Thursday.

"Three people from military security were wounded but unfortunately nobody was caught. Attacking where the president is staying -- that is an assassination attempt," he added.

"It happened in the early hours of Thursday morning."

Megaryef, who was unhurt, spoke to state television about the incident in remarks spread on social networking sites.

"At around 2 am, there were explosions and sniper shots at the hotel where we were staying. The exchange of fire lasted about three hours," he said.

The incident underscores the challenge Libya's new authorities face in securing the south, a desert region rife will illegal trafficking and full of weapons left over from the 2011 conflict that toppled dictator Moammar Gadhafi.

Tribal clashes in the oil-rich south killed hundreds of people in 2012.

In December, Tripoli imposed martial law on the region and ordered that the land borders with Chad, Niger, Sudan and Algeria be closed.