The handshake in Congress this morning between Sánchez and Rajoy Uly Martín / EL PAÍS

Spanish Congress has just conducted a historic no-confidence vote that has removed Prime Minister Mariano Rajoy from office.

This is the first time in Spanish democratic history that a head of government has been ousted. Rajoy, 63, refused to step down ahead of the vote, saying he had the trust of the people who voted for him at the 2016 election.

Rajoy is being replaced by Socialist (PSOE) leader Pedro Sánchez, whose 84 seats were insufficient for the majority of 176 required in the 350-seat house. This forced the PSOE to seek support from a range of other parties, including regional nationalists in the Basque Country and Catalonia.

The motion was successful after 180 deputies voted to unseat Rajoy.

The no-confidence motion was filed by the main opposition Socialist Party (PSOE) last week in the wake of a court ruling in a sweeping corruption scheme known as Gürtel. Rajoy’s Popular Party (PP) was fined for having benefited from the kickbacks-for-contracts network.

Follow the historic events in Spain in our live blog: