They also agreed to seek paths such as scholarships for Africans to reach Europe legally, to cut the death toll from smuggling across the Sahara and Mediterranean.
The deadly trek across the desert from sub-Saharan Africa through Libya and over sea to Italy is now the main route used by refugees and other vulnerable migrants heading to Europe.
This is because Turkey closed the other main route via Greece that brought in nearly a million people in 2015.
Almost 115,000 migrants have landed on Italian shores so far this year.
Almost 2,750 are known to have died while trying to cross the Mediterranean, the UN International Organisation for Migration said on Friday, and the death toll in the Sahara desert is thought to be at least twice as high.
European and African officials say the numbers reaching Europe have finally been falling over the past few months due to better efforts to fight smuggling.
But that has also left tens of thousands of migrants trapped in Libya, often detained in conditions rights groups say are dangerous and inhumane.
Interior ministers belonging to the “Central Mediterranean contact group” met in Switzerland to discuss the crisis.
While they talked about law enforcement measures to combat smuggling, their final statement focused more on efforts to alleviate the journey’s harm.
Ministers from Algeria, Austria, Chad, France, Germany, Italy, Libya, Malta, Niger, Slovenia, Switzerland, Tunisia and Mali were among those backing the statement.
“We had a very intensive exchange, because the questions we are dealing with are very demanding issues,” Swiss Justice Minister Simonetta Sommaruga said after the meeting.
“This is why we concentrated on protecting refugees. We had many people with different viewpoints sitting around the table, but nonetheless, on this point we all agreed….
“We want to improve the situation of migrants and refugees, particularly in Libya.”
Sommaruga said an improvement in the situation on the central Mediterranean route would be possible only if countries joined together to help stabilise Libya.
The ministers said they would work closely with Libyan authorities to ensure detained migrants and refugees were held with respect for human rights and humanitarian standards.
They promised to secure priority release from detention for vulnerable people such as children and victims of torture.
They also pledged to create economic alternatives to smuggling, including pilot projects for pathways for Africans to reach Europe legally, such as scholarships and apprenticeships.
“We risk this time to be seen as a dark chapter in European history. If we wish to change that situation, we must get together with those states which themselves are very severely affected by migration,” Sommaruga said.