ROME — On March 3, European rescue vessels were hard at work, 20 nautical miles off the North African coast, saving migrants from ramshackle vessels dispatched from Libyan beaches by human traffickers.

It was a day like many others in the Mediterranean, as migrants headed for Europe, some hoping to build new lives, others trying to flee the violence in Libya and all part of a surge that saw a record 181,000 make the trip in 2016.

What made the day different was the appearance of a fast motor boat flying the Libyan flag and identifying itself as the Libyan coast guard, which shadowed the rescuers, waiting for the European rescue personnel to save the migrants from the boats before helping themselves to the outboard motors.

It was a troubling sign that the coast guard officers might be preparing to sell the engines back to the traffickers, making them complicit in a traffic they are meant to be halting.

That presents a problem for Europe's navies, which have been training Libyan coast guard personnel to fight the traffickers.

"Now it is time to close down the route from Libya to Italy," Donald Tusk, president of the European Union's European Council, said last month, as EU members gathered in Malta to pledge €200 million (U.S. $215 million) to fight people trafficking in Libya.

The promised money will go toward coast guard training and new detention camps in the lawless nation, which acts as a conduit for migrants heading from sub-Saharan Africa.

Signatories said the deal would "break the business model" of traffickers, who have thrived since the overthrow of strongman Moammar Gadhafi in 2011.

After 14 weeks of training by the Italian and Dutch navies on vessels in the Mediterranean, 93 Libyan coast guards were dispatched back to Libya last month following a graduation ceremony attended by Italian Defence Minister Roberta Pinotti.

The training mission, overseen by the EU, then launched a two-week course for 20 Libyan officers in Crete as well as a separate officers' course in Malta. Ten Libyan coast guard vessels, which have been stored in Italy since 2011, will be handed back for operational use in Libyan waters.

Next, planners want to reach a total of 500 recruits trained up by the summer, with further training provided by European officers, on board the vessels, in Libyan waters.

The EU training deal was struck with the United Nations-backed, Tripoli-based government of Fayez al-Serraj, who is currently having a difficult time asserting his authority much beyond his headquarters, thanks to militia fighting in Tripoli.

A greater concern for Serraj is a rival government in the eastern Libyan city of Tobruk, which is allied with military leader Gen. Khalifa Haftar, whose forces control swathes of eastern Libya.

Haftar has twice visited Moscow, signaling Russia's decision to intervene in Libya and raising fears it will get involved in hostilities as it did in Syria, aiming to rebuild its influence in the Mediterranean.

On March 14, the speaker of the Tobruk parliament, Agila Saleh, said Russia had promised to supply military assistance.

As Serraj's grip on Libya gets shakier, European officials trying to stem the flow of migrants to the continent will wonder if he will ever get a reliable Libyan coast guard off the ground.

Moreover, reports emerging from Libya point to widespread collusion between coast guard units already in operation and the traffickers handling the migrant flow.

Analysts believe that Abdurahman Milad, the coast guard chief in Zawiya, west of Tripoli, is a key figure in the local trafficking trade.

"The brother of Ibrahim Jadran, the former head of the militia guarding Libya's oil facilities, controlled the migrant boats leaving Benghazi," said Gabriele Iacovino, an analyst at the CESI think tank in Rome.

A European naval official linked to the coast guard training admitted that the Libyan coastline was full of semiofficial coast guard outfits, some linked to militias.

But he insisted there was no danger of EU funding ending up in their hands.

"The difference is that we have been working through the Libyan Navy, which is answerable to Serraj, and all our recruits are from the Navy," he said. "When you see Libyans in uniform on a grey boat you shouldn't assume that's the Navy."

Recent events in Tripoli suggest traffickers do genuinely see Serraj and his EU-funded coast guard as more of a threat than an accomplice.

"The Tripoli militia leader Haitham al-Tajouri, who is probably linked to traffickers, stopped supporting Serraj when Serraj signed the deal to fight traffickers," Iacovino said.

"In general, the deal among militias to let Serraj into Tripoli was overturned when he signed that deal — that is no coincidence."