Want smart analysis of the most important news in your inbox every weekday along with other global reads, interesting ideas and opinions to know? Sign up for the Today's WorldView newsletter.

In the span of a day this week, President Trump warned of immigrants “infesting” the United States, and Italy's new far-right interior minister promised to “purify” his country through mass deportations of asylum seekers. Meanwhile, Spain took a different tack.

On Sunday, the Aquarius, a vessel operated by an aid organization and bearing 629 migrants from sub-Saharan Africa, docked in the Spanish city of Valencia. It had been turned away from Italy, where the populist government is taking a hard-line stance against migrants, and then Malta. But Spain's new Socialist prime minister, Pedro Sánchez, said he wanted to stave off a “humanitarian catastrophe” and welcome the hundreds of migrants, who will have the right to apply for asylum.

Sánchez also moved to restore access to basic health care for migrants. Such access had been stripped by right-wing Prime Minister Mariano Rajoy, whose government Sánchez and the Socialists replaced this month after a corruption scandal rocked Rajoy's party. Sánchez's cabinet also announced plans to remove the barbed wire fences ringing Ceuta and Melilla, two Spanish enclaves in North Africa. Advocacy organizations say the barriers are both cruel and ineffective.

While the thorny debate over migration roils across Europe, Spain stands somewhat apart. Over the past couple of decades, few countries in the West have taken in more immigrants than Spain. Madrid's decision to allow the Aquarius to dock also proved popular.

“Everybody in Europe is being affected by this virus, fears of immigration,” Josep Borrell, Spain's new foreign minister, said to Today's WorldView during a visit to Washington accompanying the Spanish king. “This is not the case of Spain.”

At a time when Euroskeptics abound elsewhere, Borrell said, nobody in Spain “contests that our future has to be built inside the European Union.”

That's a happy message for beleaguered politicians in Brussels and Berlin. Although Rajoy was a somewhat subdued actor on the European stage, Sánchez is set to play a bigger role. That's perhaps out of necessity: The Socialists now rule as a minority government, getting limited support from regional factions and parties further to the left. That means they may have little room to pass significant legislation. The executive, though, has freer rein over foreign policy.

Sánchez is set to call on French President Emmanuel Macron this weekend, the first meeting between two similarly youthful and dynamic leaders who champion European integration. “Sánchez will do something similar to Macron,” said Miguel Otero Iglesias, a senior analyst at the Elcano Royal Institute in Madrid, suggesting that the new prime minister may seek to gain “status and statesmanship in Spain by having a more active role internationally.”

Borrell, 71, is a former president of the European parliament and is seen as an elder statesman in Sánchez's cabinet. In our conversation, he pointed to the necessity for E.U. countries to hash out a substantive joint plan to reckon with the migration crisis. Countries such as Italy and Greece complain of the inequities of being on the front line, while some governments in Eastern and Central Europe resent directives from Brussels mandating they take in any asylum seekers.

Borrell sympathized with the Italian perspective, but he championed the efforts taken by some countries, including Spain, to hash out deals with African nations as well as boost development there. “This is not a matter of charity,” he said, but of economic interest and humanitarian duty.

That's an argument voiced by other center-left politicians on the continent. “Europe must invest in Africa, where lately China has done a great deal more than the old continent has,” Matteo Renzi, the former Italian prime minister whose party slumped in recent elections, wrote for The Post. “To handle the migration flows, it is necessary to cut European funding to member states — such as some in Eastern Europe — that do not welcome migrants: solidarity that characterizes European finances must be matched with solidarity in our welcome.”

Borrell said that while anti-immigrant populists and illiberal governments in countries such as Hungary and Poland reflect public opinion and must be taken seriously, “some of their attitudes are not acceptable from the point of view of European values.”

“We can discuss the number of migrants you have to accept. But we cannot discuss that you only take migrants according to their religion,” he added, referring to Central European leaders who have said they would be willing to welcome only Christian refugees.

Borrell turns to Spain's turbulent history to justify its special embrace of “European” values and refusal (so far) of far-right populism.  “We have been vaccinated by the [Spanish] civil war and by the long years of [Francisco] Franco's dictatorship,” he said. His government is set to follow through on left-wing demands to exhume the dictator's remains and remove them from a hallowed national monument to the pre-World War II conflict.

But the ruling Socialists also have to reckon with divisions in Spain. Borrell, a Catalan, was staunchly opposed to Catalonia's bid for secession but was also critical of the heavy-handedness employed by Rajoy in the latter stages of the crisis last year. While he scoffs at the “propaganda” the independence camp used to win sympathy abroad, he believes that the only solution is through dialogue — especially since a secessionist government sits in power in Barcelona.

A veteran politician, the Spanish foreign minister also recognizes the broader challenges of the political moment. His own party has lost support to newer movements on the left that emerged in the wake of the financial crisis, which ravaged Spain. “We are living what can be called the counter-shock of globalization,” he said. “Social democracy once represented 40 percent of the voters everywhere, from Sweden to Spain, from United Kingdom to Greece. And now it's the party of 20 percent in the best of the cases everywhere.” Center-right parties, he said, face the same dilemma.

“Social democracy was a force to fight against inequality and created the most balanced societies in the world — the best combination of political freedom, economic prosperity and social cohesion,” he said. “These values are today as relevant as ever, because inequality is the big danger for our societies. We have the opportunity of proving again that we can provide solutions in the way we did in the aftermath of the Second World War.”

Want smart analysis of the most important news in your inbox every weekday along with other global reads, interesting ideas and opinions to know? Sign up for the Today's WorldView newsletter.