France says it plans to set up "hotspots" in Libya to process asylum seekers, in a bid to stem the flow of migrants to Europe.
President Emmanuel Macron said the move would stop people not eligible for asylum from "taking crazy risks". The centres would be ready "this summer".
He said that between 800,000 and a million people were currently in camps in Libya hoping to get into Europe.
But many of them did not have a right to asylum, Mr Macron said.
The French leader said that migrants were destabilising Libya and Europe by fuelling people-smuggling, which in turn funded terrorism.
"The idea is to create hotspots to avoid people taking crazy risks when they are not all eligible for asylum. We'll go to them," he said on Thursday at a naturalisation ceremony in the central city of Orléans.
On Tuesday, Mr Macron mediated talks in Paris between Libya's opposing governments.
UN-backed Prime Minister Fayez al-Sarraj and Khalifa Haftar, the rival military commander who controls the east, committed to a conditional ceasefire after the meeting.
They are aiming to end the conflict which has engulfed the country since Col Muammar Gaddafi was ousted in 2011.
Mr Macron and other EU leaders had been hoping for some sort of agreement, as Libya has become a key route for migrants making their way to Europe.
The French leader said he hoped the deal would be a blow to the human traffickers who work in the region.
More than 110,000 migrants from northern Africa and the Middle East have made a perilous journey across the Mediterranean to Europe this year, the UN says.
It estimates that more than 2,300 people have drowned or are missing.
Last year, 362,753 migrants arrived into the EU by sea, the vast majority of them to Italy and Greece.
In a separate development, the European Court of Justice on Wednesday ruled that a law requiring refugees to seek asylum in the first country they reach applied even in exceptional circumstances.
The case could affect the future of several hundred people who arrived during the migrant crisis of 2015-16.
In 2015, France offered asylum to 20,630 refugees, according to the EU's statistics agency, Eurostat.
A note on terminology: The BBC uses the term migrant to refer to all people on the move who have yet to complete the legal process of claiming asylum. This group includes people fleeing war-torn countries such as Syria, who are likely to be granted refugee status, as well as people who are seeking jobs and better lives, who governments are likely to rule are economic migrants.