Turkey is playing "a dangerous game" with its military intervention in Libya that will not be tolerated by France, President Emmanuel Macron has warned.
Air support and weapons from Turkey over recent months have helped change the tide in Libya's civil war.
The UN-recognised government pushed back a year-long siege on the capital Tripoli at the beginning of June and has secured much of the west of the country against Khalifa Haftar's Libyan National Army (LNA).
Turkey's military support — and the allied fighters it has transported from Syria — contributed to the Tripoli government's gains over the LNA, which is backed by Egypt, Russia and the United Arab Emirates.
But Macron said Turkey's actions went against commitments it made during Berlin peace talks in January.
"I have already had the opportunity to say very clearly to President Erdogan I consider today that Turkey is playing a dangerous game in Libya and is in breach of all commitments it took during the Berlin conference," he said.
France has previously given military support to Haftar to fight Islamist militants and denies supporting his side in the civil war.
But Macron has not criticised countries allied to the LNA, even though he has often rebuked Turkey.
Last week France accused Turkey of harassing a French ship off the coast of Libya while it carried out checks on a Turkish ship that it suspected of breaking a UN arms embargo to Libya.
A French defence ministry account of the encounter — which occurred several weeks ago — said that Turkish frigates carried out radar targeting on a French ship, suggesting a missile strike was imminent.
Turkey denies this happened.
But Macron said on Monday that the incident between two NATO allies was an indication of the military alliance's weaknesses.
"When I see what is being done last week under NATO's command off the coast of Libya, I consider it unacceptable," he said.
"And I'll take you back to my statement last year on NATO being brain dead. I think this is the best example of it."
The French president first made the "brain dead" remark last November, criticising what he considers the military alliance's failure to treat seriously the external threats to southern Europe and the Baltic states.