The European Union unveiled a new plan Wednesday to resettle at least 50,000 refugees, the majority of them from northern Africa.

The EU’s executive branch, the European Commission, said it has set aside 500 million euros ($587 million) for the effort. It wants refugees in Libya, Egypt, Niger, Sudan, Chad and Ethiopia to be the focus.

Libya is the main jumping-off point for many people willing to brave potentially perilous sea voyages across the Mediterranean in search of better lives in Europe. Egypt, Sudan, Chad and Niger — one of the main migrant transit countries in Africa — all border Libya.

Most of the migrants crossing the Mediterranean probably would not qualify for asylum in Europe, but the EU wants to make sure that genuine refugees do not have to face the dangerous sea crossing.

“Europe has to show that it is ready to share responsibility with third countries, notably in Africa. People who are in genuine need of protection should not risk their lives or depend on smugglers,” EU Migration Commissioner Dimitris Avramopoulos said.

European countries are individually responsible for deciding on resettlement numbers so they cannot be legally bound by Brussels to take more people in.

The Commission also wants to set up pilot projects to help create more legal ways for nationals of countries that are cooperating with the EU to come to Europe.

The move is part of the EU’s effort to cope with hundreds of thousands of refugees and unauthorized migrants who have tried to enter Europe in recent years, undermining European solidarity as countries bickered over how to manage the problem.

The EU’s executive arm also wants to ensure that those not permitted to stay are returned to their home countries more quickly. Only around one third of those deemed ineligible are actually sent back.

“We have to be clear and brutally honest, people who have no right to stay in Europe must be returned,” Avramopoulos said.

He also said that the Commission would propose a temporary extension to allow countries like Germany, Austria, Denmark and non-EU country Norway to keep systematic ID checks in place.

Avramopoulos it would modify the rule book governing the 26-nation passport-free travel area known as Schengen, where systematic checks on all travelers are not allowed. It would authorize border checks for another two years.

Border control

Temporary border controls inside the European Union’s free-travel zone could be extended for up to three years during a crisis, the European Commission proposed on Wednesday, giving it more leeway to stem migration.

The proposal by the EU executive comes as border controls in Germany, Austria, Denmark, and Norway expire, part of the European Union’s response to a surge of refugees and migrants in November 2015 that tested EU rules on passport-free travel.

Those countries must lift the frontier checks by November this year under a two-year-limit set by the bloc in the so-called Schengen area, which is named after a town in Luxembourg and aims to be a symbol of free movement in the bloc.

While not referring to the four countries, the Commission’s plan, if agreed by EU governments, would allow them to keep the controls in place for another year if they can justify them.

EU home affairs commissioner Dimitris Avramopoulos said the threat of migrants coming through Greece and the Western Balkans was no longer a valid excuse for frontier checks.

“No internal border control … in relation to those from the eastern Mediterranean will be possible after November,” Avramopoulos told a news conference.

“All member states maintain the possibility to introduce internal border controls for other threats to their internal security,” he said, stressing those “must remain exceptional.”

Germany has long argued it needs the controls to combat the threat of Islamic militancy in Europe.

The EU has taken in more than 1.7 million people from the Middle East and Africa since 2014. But after a mass influx in 2015, numbers have gone down steadily following a 2016 deal that closed the route from Turkey to Greece. The EU has also stepped up support for Libya to curb arrivals in Italy.

Sweden has lifted its border checks but has stepped up internal controls. Norway is part of Schengen but not the EU.