Ireland is among six countries which have agreed to relocate migrants stranded on board a rescue ship in the Mediterranean.

Maltese navy boats will transfer the migrants on the Ocean Viking to land and they will then be relocated to other member states.

The ship is anchored in international waters between Malta and the southern Italian island of Linosa.

Malta had denied the ship entry, and Prime Minister Joseph Muscat said none of the migrants will remain in the country after the transfer operation.

France has said it will take 150 people with Germany, Luxembourg, Portugal and Romania also agreeing to relocate them.

Taoiseach Leo Varadkar spoke by phone to Mr Muscat today to confirm that Ireland will take a small number of migrants from the Ocean Viking.

In a statement to RTÉ News, a spokesperson for the Minister for Justice said that Ireland has decided to accept the relocation of up to 100 asylum seekers from this summer until the end of 2019. 

"This figure takes account of the extremely tight accommodation situation that currently exists while at the same time showing solidarity with our EU colleagues," it said. 

At the end of July eight EU member states, including Ireland, agreed to be part of a new plan to resettle migrants and refugees rescued in the Mediterranean. 

EU Commissioner for Migration Dimitris Avramopoulos tweeted that a solution has been found for all those on board the Ocean Viking and praised the six countries who agreed to relocate the migrants.

Yesterday, two charities running rescue missions in the Mediterranean Sea said Italy had ignored requests to allow their ship to bring the 356 people ashore.

The Norwegian-flagged ship, Ocean Viking has been stranded at sea for two weeks awaiting port access.

The ship is carrying mostly Africans from Sudan, plucked from the sea in four separate missions.

They include more than 100 minors, around 90 of them unaccompanied, Médecins Sans Frontières said.

Three children are under the age of five.

Luca Pigozzi, a doctor on board, said that while most migrants were in a stable physical condition, he feared the impact of psychological damage caused by violence suffered when fleeing their home country.

"The situation on board is becoming more tense," he said.

In a statement, MSF said while the six countries have "stepped up to give a humane response, European governments must stop these prolonged delays and ad hoc petty negotiations".

It called for a "disembarkation mechanism for people rescued at sea" to be set up as a matter of urgency.

Jay Berger, MSF Project Coordinator on board the Ocean Viking, said there is relief that the ordeal for those on the ship is finally over.

"Was it necessary to impose two weeks of excruciating wait for rescued people to be disembarked? These are people who have fled from desperate circumstances in their home countries and suffered horrific abuses in Libya," he said.

The Ocean Viking carried out its first rescue on 9 August and over the following four days 356 people were brought on board, with the youngest being just one year's old.

Additional reporting: Jackie Fox, David Murphy