ABOARD SEA-WATCH 3, Off Malta — Four years ago, he escaped jihadists in West Africa. Last year, he survived slavery in Libya. But for Daouda Soumana, a 20-year-old trader from Niger, one of the cruelest experiences of his quest for safety occurred this week — within sight of the southern shores of Europe.

From the deck of the Sea-Watch 3, a rescue ship owned and run by a small German charity, Mr. Soumana could see the white cliffs of Malta gleaming in the sunlight, and even the outlines of seaside buildings. The German crew members could reach that coast within 45 minutes by speedboat. Not Mr. Soumana.

He was one of 49 migrants stranded aboard a pair of rescue ships whose requests for safe harbor had been ignored or refused by every national government bordering the Mediterranean Sea since their rescue in December, until Malta agreed on Wednesday to let them come ashore

“We are crying,” Mr. Soumana said in an interview on the boat this week, before Malta announced the move. “We can see Malta with our own eyes, but we are still stuck on this ship.”