Six EU countries have agreed to accept 356 African migrants aboard the rescue vessel Ocean Viking, which was not allowed to land in Italy or Malta.

The migrants, mostly from Sudan, cheered and danced as they heard the news. Malta’s navy will land her, but Malta will not let her stay.

France, Germany, Ireland, Luxembourg, Portugal and Romania will host.

SOS Méditerranée, one of the participating French charities, had called for a resolution after two weeks at sea.

It was said that people were dying because the system of rescuing migrants from drowning had collapsed.

It has been the recent tense dispute between charities and EU governments, as there is no binding EU agreement on the relocation and placement of non-EU migrants.

SOS Méditerranée operates the rescue ship together with Médecins Sans Frontières (MSF). France has agreed to accept 150 of the migrants and Portugal up to 35. The other allocations are not clear yet.

EU Migration Commissioner Dimitris Avramopoulos has negotiated the agreement with Malta and the other six EU countries.

On Tuesday, about 100 migrants stranded aboard another rescue vessel, the Open Arms, which disembarked after 19 days at sea on the Italian island of Lampedusa. They were only allowed to go ashore when five other EU countries also agreed to accept them.