VALLETTA (Reuters) - The Mediterranean rescue ship Aquarius arrived at Valletta harbor in Malta on Wednesday to allow 141 migrants to get off, ending a five-day tug-of-war among European Union countries which had seen the vessel banned from docking in several ports.

The ship, run by the Franco-German charity SOS Mediterranee and Doctors without Borders (MSF), was allowed in after France, Germany, Luxembourg, Portugal and Spain agreed on Tuesday to take in the migrants, who were rescued off the coast of Libya.

Aid groups said there were more than 70 children on board.

The EU countries will also take some of a group of 114 migrants who were rescued by the Maltese armed forces and brought to Malta on Monday.

The row was the latest tussle illustrating how politically fraught the issue of coping with seaborne migrants remains despite a deal on migration that EU leaders agreed on at a summit in June.

Malta had initially argued that the migrants on board the Aquarius should be taken to Libya, Tunisia or the Italian island of Lampedusa, all closer to the rescue points.

As the ship docked, members of a right-wing group Moviment Patrijotti Maltin (Malta Patriotic Movement) unfurled a banner reading “Stop Human Trafficking”. Next to them, crew members of another rescue vessel, the MV Lifeline, held up a banner of their own reading “Everyone has a right to life.”

A government spokesman said the ship’s migrants, mostly from Eritrea and Somalia, would be given an initial medical check before being taken to a reception center.

This was the second time in as many months that the Aquarius was at the heart of a Mediterranean standoff. It was refused entry by Italy and Malta in June, and the boat eventually docked in Spain, which took in its migrants.