BARCELONA, Spain (AP) — The leaders of Germany and Spain on Saturday promoted a shared approach to immigration into the European Union amid growing populist opposition in other EU nations to taking in more asylum-seekers.

German Chancellor Angela Merkel and Spanish Prime Minister Pedro Sanchez, meeting at a country estate in the southern region of Andalusia, advocated a “fair distribution” of migrants for EU nations. They said they will share their common vision at an EU summit next month in Austria.

“No country can be exempt from this challenge,” Merkel said at a press conference after the meeting. “The racist tendencies we are seeing, regrettably, in all member countries is something we have to fight against.”

Spain has become the primary destination for migrants attempting to reach Europe by sea in recent months. While largely welcoming, Sanchez’s Socialist government is trying to stem the flow of migrants across the Mediterranean by holding talks with Morocco, one of the main departure points now used by traffickers to cross the sea.

As part of that effort, Sanchez asked Merkel for greater financial cooperation from the EU to assist Morocco and Tunisia with migrant control programs.

“We have to intensify our support for Morocco and Tunisia,” Merkel said. “They are border countries and they need our help.”

The International Organization for Migration says almost 24,000 refugees and other migrants have arrived in Spain by sea this year — nearly triple last year’s number. At least 1,500 other migrants have died so far this year in the dangerous Mediterranean crossing.

The two EU leaders had previously agreed to a deal in which Spain will take back migrants already registered there who try to enter Germany through Austria. The agreement took effect Saturday.

Merkel has been seeking bilateral agreements with Spain, Greece and Italy to stop so-called “secondary” migration to Germany, an issue that nearly took down her government several months ago. Negotiations with Greece and Italy are ongoing.