MADRID — During more than a decade on the front line of Spanish politics, Prime Minister Mariano Rajoy withstood electoral defeats, a banking bailout and mass street protests over his austerity cuts. He led Spain out of financial crisis and back to growth.

But on Friday, Mr. Rajoy became the first Spanish leader in modern history to be unseated by a parliamentary revolt. He was ousted over a corruption scandal that will leave the country with a fragile, possibly short-lived, government.

His removal was part of a broader upheaval at Europe’s core. It came on the same day that a new government led by anti-establishment, populist parties took control in Italy.

In addition, Britain is abandoning the European Union, Poland and Hungary are rolling back democracy, and the United States is waging a trade war on its European allies. The chaos ushered in by these changes has already unsettled financial markets and European Union leaders in Brussels.