Unidentified gunmen have opened fire on a convoy carrying the prime minister of Libya's UN-backed government, Fayez al-Sarraj, in Tripoli without causing any casualties, according to his administration.

Ashraf al-Thulthi, the administration spokesman, said on Monday that the incident occurred as the motorcade passed near the Abu Salim district of the Libyan capital.

"All the cars were armoured-plated, and there were no injuries," he said, adding an investigation was under way to identify the attackers.

It was unclear whether it was a targeted attack, Thulthi said.

The convoy was also carrying Abdurrahman Swehli, the head of the state council, Najmi Nakua, the commander of the presidential guard, according to Thulthi.

READ MORE: Libya conflict explained

Sarraj's Government of National Accord (GNA) said in a statement that Sarraj, Swehli and Nakua had opened a new criminal investigations unit in Tripoli on Monday morning, and published pictures of the three at the event. It did not mention the shooting.

Sarraj and the GNA's other leaders arrived in Tripoli last March following a UN-backed deal signed in late 2015.

Yet, his Tripoli-based government has struggled to impose its authority, particularly in eastern Libya where a rival administration holds sway.