BRUSSELS (Reuters) - The European Union will cease the maritime patrols that have rescued thousands of migrants making the perilous Mediterranean Sea crossing from North Africa to Europe, but it will extend air missions, two diplomats said on Tuesday.

FILE PHOTO: Migrants, intercepted off the coast in the Mediterranean Sea, wait to disembark from a rescue boat at dawn at the port of Malaga, southern Spain, January 15, 2019. REUTERS/Jon Nazca-/File Photo

A new agreement on the EU’s Operation Sophia was hammered out after Italy, where anti-migrant sentiment is rising, said it would no longer receive those rescued at sea.

Operation Sophia’s mandate was due to expire on Sunday but should now continue for another six months with the same aim of detering people smugglers in the Mediterranean. But it will no longer deploy ships, instead relying on air patrols and closer coordination with Libya, the diplomats said.

“It is awkward, but this was the only way forward given Italy’s position, because nobody wanted the Sophia mission completely shut down,” one EU diplomat said.

A second diplomat confirmed a deal had been reached and said it must be endorsed by all EU governments on Wednesday.

The tentative deal, however, could weaken Operation Sophia’s role in saving lives in the sea where nearly 2,300 people perished last year, according to United Nations figures.

From the more than one million refugees and migrants who made it to the bloc during a 2015 crisis, sea arrivals dropped to 141,500 people in 2018, according to the United Nations.

Still, Italy’s deputy prime minister Matteo Salvini, has said his country would no longer be the main point of disembarkation for people trying to cross the Mediterranean by boat and rescued by Sophia’s patrol ships.

Rome called for other countries to open up their ports instead, but no other EU states came forward. Diplomats said countries including Spain, France and Germany signaled they were not willing to host more rescued people - most of whom are fleeing wars and poverty in Africa and the Middle East.

However, EU governments did want the mission to continue because they felt it had been effective in dissuading smugglers.

The compromise discussion in Brussels did not discuss military aspects of the role of air patrols. But the new arrangement will involve more training of the coast guard in Libya, where lawlessness has allowed smugglers to openly operate sending people to Europe by sea.

But it would be in line with the EU’s policy of turning increasingly restrictive on Mediterranean immigration since the surge in 2015 and discouraging people from risking their lives in the sea in trying to cross to Europe where governments do not want them.

The bloc has already curbed operations of EU aid groups in the part of the Mediterranean in question and moved its own ships further north where fewer rescues take place.