TRIPOLI (Reuters) - A convoy carrying the prime minister of Libya’s U.N.-backed government and the two leaders of an allied parliament and presidential guard came under fire in Tripoli on Monday, but none of the three men were harmed, officials said.

A spokesman for the U.N.-backed government, Ashraf Tulty, said the motorcade had been hit by gunfire as it passed through Tripoli’s Abu Salim district. It was unclear who was behind the shooting or whether it was a targeted attack, he said.

Security in Tripoli is highly volatile. The city is controlled by multiple armed groups, some of which support the U.N.-backed Government of National Accord (GNA) and some of which oppose it. There are frequent clashes and shootings.

The convoy that came under fire on Monday was carrying GNA Prime Minister Fayez Seraj, State Council head Abdurrahman Swehli, and the commander of a fledgling Presidential Guard, Najmi Nakua, Tulty and a spokesman for Swehli said.

Tulty said reports from Swehli’s office that two guards had been injured were inaccurate, though he said some bullets had struck the convoy’s armored vehicles.

“There is an ongoing investigation into the source of the shooting. They want to figure out if there was any party behind the shooting or if it was random,” Tulty said.

A statement from Seraj’s office said just one vehicle had been hit as the convoy returned from the opening of a new headquarters for a criminal investigations unit. It said no-one had been wounded.

Seraj and other GNA leaders arrived in Tripoli last March in an effort to unite Libya’s factions and end the turmoil that has roiled the country since its 2011 uprising.

But his government has remained half-formed, unable to win backing from power-brokers in eastern Libya or effectively impose its authority in Tripoli and the west.