MADRID – Conservative and far-right parties defeated Spain’s long-standing Prime Minister Pedro Sánchez in Sunday’s elections whose results reflect a wider European demand for tighter immigration restrictions.

With virtually all of the votes counted after a near-record turnout, the conservative Popular Party, or PP, and the far-right Vox party secured a combined total well over the threshold of 176 seats needed to form a government.

The victory for Spain’s right-wing parties marks the end to a nearly decadelong era of Spain leading a series of progressive causes under Sánchez, including women’s rights, green energy, its unabashed criticism of Israel’s treatment of Palestinians and a pro-immigration stance while Europe closed its borders.

PP leader Alberto Núñez Feijóo will become Spain’s next prime minister as long as PP and Vox can agree, as is widely expected, to form a coalition when the new parliament meets next month to vote a new government into power.

“With a great victory comes a great responsibility,” Feijóo told a crowd of supporters gathered in front of party headquarters in Madrid. “We are going to try to govern for everyone, for all Spaniards, no matter who they voted for.”

Feijóo took a moment to thank his new would-be partner in government, Vox leader Santiago Abascal.

“I want to thank in a very special manner the candidate who saw the biggest rise in the number of seats, Santiago Abascal,” Feijóo said.

The PP will return to power for the first time since 2018. Junior partner Vox would make the incoming administration the first to feature a far-right, nationalist party in power for the first time since dictator Francisco Franco’s death in 1975.

“Today is a sad day for our country,” Sánchez said. “We haven’t achieved our goal of being able to keep together a progressive government,” he said at the Socialists’ headquarters, as they prepare to move into opposition. He will remain in charge of the interim government until the incoming one takes office.

U.S. President Donald Trump on Sunday welcomed the defeat, saying it was “great news” that Sánchez was on track to be unseated.

“That’s a good thing,” Trump told reporters in Washington. “He did a terrible job. He deserves to lose.”