ROME (Reuters) - A humanitarian boat carrying 59 migrants rescued off Libya was heading for Barcelona on Sunday after Italy and Malta, both much closer to the place of rescue, had refused to let it dock in their ports.

Slideshow ( 2 images )

The boat Open Arms, run by the Spanish Proactiva Open Arms charity, said late on Saturday it was “going home” after receiving an offer of a safe port from Barcelona’s mayor Ada Colau.

In a tweet, it denounced the “inhuman policies and closed ports in Italy and Malta” and said the boat would arrive in Barcelona on Wednesday.

In a similar episode on June 11, Spain offered to take in another charity rescue boat, Aquarius, with 629 migrants aboard, after Italy and Malta had barred its ports.

The travails of the Aquarius, which finally docked in Valencia, triggered a barrage of insults and accusations among European Union Countries over who should take responsibility for migrants picked up in the Mediterranean.

EU leaders on Friday came to a hard-fought agreement over migration which Italian Prime Minister Giuseppe Conte said was positive for Italy, the European nation that has borne the brunt of migrant arrivals by sea in recent years.

However, the agreement does not oblige other EU states to share the burden of rescues in the Mediterranean.

“Thank you for doing the most difficult part, saving lives, and thank you for not giving up in the face of cruel and inhuman European policies,” Colau tweeted. “Barcelona awaits you with open arms.”

Proactiva Open Arms said the migrants on board the boat, who it picked up early on Saturday, included five women and four children, and were of various nationalities including Palestinians, Syrians and Guineans.

More than 650,000 migrants have come ashore in Italy since 2014, mostly after being rescued at sea off the Libyan coast by private and public groups. Italy is sheltering about 170,000, but the number of arrivals has plummeted this year.

Despite the decline in arrivals, there are still daily stories of disasters as migrants make the perilous crossing from Africa to Europe. The Libyan coastguard said around 100 were thought to have drowned off Tripoli on Friday.