The governments of Spain, Greece and Germany have reached a special trilateral agreement that will free up 25.6 million euros in funding from the European Union to help Spanish authorities cope with the influx of migrant traffic from North Africa to Spain.

The accord, announced in tandem with an emergency migration deal among European countries reached after overnight negotiations and announced in Brussels on Friday, provides for Spain’s Ministry of Employment and Social Security and the Spanish Red Cross to receive 24.8 million euros to help fund a program providing emergency healthcare, food and shelter to migrants arriving to southern Spain and the North African enclave cities of Ceuta and Melilla.

An additional 720,000 euros in EU funding will go to Spain’s Interior Ministry to help improve the processing of arriving migrants and the return to their country of origin of those who do not qualify for asylum as refugees.

The overall European deal announced Friday in Brussels is a stop-gap measure that falls short of a complete overhaul of EU migration and asylum regulations, but was said to address the immediate concerns of Mediterranean coastline countries, such as Italy, Greece, Malta and Spain, which bear the brunt of the ongoing arrival by sea of hundreds of migrants on a daily basis. Other EU member states, including Hungary, Austria and Poland, who say they cannot cope with the influx of onward-travelling migrants who are either passing through or intend to remain in their countries, were less than enthusiastic about the accord because of its failure to address fundamental reform of the EU’s migration and refugee policies.

The current crisis came into sharp focus after the ascension to power last month of Italy’s new populist coalition government and its subsequent refusal to allow rescue vessels operated by non-governmental organisations bearing hundreds of migrants picked up in the waters of the the eastern Mediterranean to dock at Italian ports and disembark the migrants.

The Italian and Maltese governments, pointing to what they said is an unsustainable situation and saying NGO rescue operations were effectively encouraging human trafficking gangs operating out of Libya to increase the flow of migrants on small overloaded boats bound for Italy, precipitated the crisis by refusing to allow the Aquarius rescue vessel operated by Doctors Without Borders (Médecins Sans Frontières) to dock and offload 629 migrants rescued at sea. The Spanish government then stepped in and on humanitarian grounds agreed to accept the migrants, who were offloaded from the Aquarius and two accompanying Italian vessels at the Spanish port of Valencia.