BRUSSELS (Reuters) - NATO agreed on Thursday to broaden its operations in the Mediterranean to help the European Union stop criminals trafficking refugees from North Africa but will not act until the fate of rescued migrants is cleared up.

U.S. Secretary of State John Kerry said a meeting of NATO foreign ministers supported the wider role as Europe struggles with failing states on its fringes and said NATO should link up with the EU’s “Sophia” naval mission in the area.

This could be a step towards NATO helping stabilise Libya by patrolling coastal waters to uphold a U.N. arms embargo and counter the growing presence of Islamic State, a step that would likely need U.N. Security Council support, diplomats said.

“NATO can play a maritime role in terms of assisting operation Sophia in order to prevent illegal migration, illegal human trafficking from taking place,” Kerry told reporters.

“There was a unanimous sense in the discussions we had today that NATO could help,” he said, stressing NATO would have no combat role in the region.

NATO Secretary-General Jens Stoltenberg echoed that, saying: “We agreed that the alliance can do more in the Mediterranean,” setting out a range of areas where NATO ships could act, including gathering intelligence and interdiction.

The European Union, fearing a repeat of last year’s uncontrolled migrant flows across the central Mediterranean as the weather improves, has sought to enlist NATO’s help to tackle the worst migration crisis since World War Two.

A first move was to set up a mission in the Aegean Sea, a major route for migrants crossing from Turkey to the Greek islands, with NATO ships patrolling there with the EU’s border agency Frontex and local coastguards.

That has dramatically cut the number of migrants risking their lives to reach Europe in flimsy boats, part of a wider deal between the European Union and Turkey in which Ankara takes in migrants fleeing civil war in Syria in return for EU aid.

Stoltenberg said the United States will assign a ship to that mission, which includes German and Canadian vessels and has turned back over 100 migrant boats since starting in February.

But EU officials worry new migrants will attempt the dangerous sea crossing from Libya to Italy, which in April 2015 saw 800 migrants lose their lives in a single tragedy when the boat they were travelling in capsized.

The EU’s “Sophia” mission operates in international waters near Libya, but too far out to destroy boats used by people smugglers, catch traffickers or head off migrants trying to reach Europe by sea from Libya.

NATO is now looking to its so-called Active Endeavour counter-terrorism mission in the Mediterranean, set up after the Sept. 11 attacks on New York and Washington in 2001, to switch roles and link up with Sophia.

Both the EU and NATO say that if requested by the new U.N.-backed government in Libya, they could operate closer to Libyan shores to help deter smugglers.

One of the biggest obstacles is what to do with migrants rescued close to North African shores, who cannot be safely returned to Libya because of the chaos in the country.

“This is one of the important issues we have to look into,” Stoltenberg told reporters.

ISLAMIC STATE THREAT

Libya, which descended into anarchy after the West helped rebels topple Muammar Gaddafi in 2011, has struggled with rival governments and is only beginning to see Prime Minister Fayez Seraj established in Tripoli.

Just three days after world powers met in Vienna to offer aid to the U.N.-backed unity government in Tripoli, NATO foreign ministers also discussed how the alliance could help set up a Libyan Defence Ministry in the lawless country, and to work with the European Union to train police and border and coastguards.

Britain would like to see that training in Libya itself, whereas Germany is adamant its personnel will not be on the ground in the country and that training should be in Tunisia.

The new Libyan government, which has yet to establish itself across the country, is also wary of being seen as a foreign puppet and is keen to show its independence.

“We have a NATO offer to the Libyan government to do more training and capacity building there, which the Libyans have not yet opened formal conversations with NATO about,” said a senior U.S. State Department official.

Stoltenberg said he expected the Libyan government to send a team of experts to Brussels to determine exactly where the U.S.-led alliance could help.

Islamic State gained control over the Sirte last year and has built up its most important base outside Syria and Iraq in the Libyan coastal city. However, it has struggled to hold on to territory elsewhere in Libya.