Across Libya, the euphoria of the NATO-backed rebellion has long since faded as fighting has raged on between rival governments and feuding militias.

In the government-held west of the country, France is widely resented for the political support it has given military strongman Khalifa Haftar whose forces dominate a rival administration in the east.

Levy flew into Libya's government-held third city Misrata in a private jet on Saturday, airport sources said.

He told pro-government television channel Libya Al-Ahrar that he had travelled to the country as a journalist to write a piece for the Wall Street Journal.

Levy said he planned to visit the town of Tarhuna, where government forces uncovered a mass grave they say contains the bodies of civilians executed by Haftar loyalists.

Armed groups loyal to the government said they had prevented Levy from entering Tarhuna on Saturday.

But in tweets accompanying photographs of himself flanked by masked gunmen in military uniforms, the French celebrity philosopher said he had visited the "killing field" in Tarhuna where 47 people, including children, had "suffered martyrdom from pro-Haftar proxies".

"Just after my reportage on the killing fields. These are the true Libyan police who protect free press. So different from the thugs who tried to block my convoy on my way back to Misrata," he wrote in a caption.

He said a full account of what happened would be published soon.

A programme published by Libyan media showed that Levy planned to visit the capital Tripoli on Sunday for talks with Interior Minister Fathi Bashagha.

But the office of Prime Minister Fayez al-Sarraj denied "any connection" to Levy's visit and said it had opened an inquiry to establish how it had come about and to take "deterrent measures" against its organisers.

Although Levy enjoys celebrity status in France, he is unpopular in the Arab world because of his staunch support for Israel.