MADRID (Reuters) - The European Commission is willing to increase funding to Spain and Morocco to help manage a rise in migration across the western Mediterranean, though the budget is limited, its President Jean-Claude Juncker said.

Slideshow ( 8 images )

During his two months in office, Spain’s Socialist Prime Minister Pedro Sanchez has intervened in Europe’s immigration crisis by offering shelter to hundreds of refugees rescued at sea who other European Union states had refused to accommodate.

On Wednesday, Juncker tweeted a copy of a letter in which he told Sanchez that the EU was willing to increase financial support to Spain and also Morocco.

They are separated by a narrow stretch of water, while Spain’s Ceuta and Melilla enclaves also share a land border with Morocco.

While EU funds for North Africa were limited, “as soon as we have the necessary funds for this program, it will be subject to a new increase, both during this year and in 2019,” Juncker wrote, without giving details.

Madrid expects to spend 30 million euros on the early stages of migrant arrivals, and Juncker said the EU was treating as a priority a request for emergency assistance for its border police.

Spain has traditionally been a net beneficiary of the EU budget, but in 2016 it was virtually in balance between payments and receipts, according to official data.

Juncker also referred to a letter last week in which Sanchez flagged his anxiety about the increase in migrant arrivals in Spain to close to 24,000 this year, almost as many as made the trip throughout 2017.

As arrivals have increased, the immigration debate has become more politicized in Spain, with Sanchez’s opponents accusing him of encouraging people to travel there while other countries, notably Italy, tighten border controls.

Despite a sharp fall in irregular migration to the EU since 2015, surveys show it is still a top concern among the bloc’s around 500 million citizens.

In July, the EU agreed to spend 55 million euros ($64 million) to help Tunisia and Morocco manage their frontiers.