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 rightwing parties marks the end to a nearly decade-long 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.