The future of Spain's Prime Minister Mariano Rajoy hung in the balance on Thursday, with the opposition Socialists a whisker away from forcing him out of office as deputies began debating a no-confidence motion against his government.

Socialist leader Pedro Sanchez needs an absolute majority of 176 votes to become Spain's new Prime Minister, and information from various parties suggested he had secured 175 as the parliamentary session got under way.

Rajoy's departure would trigger a second political crisis in southern Europe, further unnerving financial markets already wrongfooted by failed attempts to form a government in Italy three months after a national election.

The no-confidence vote is scheduled for Friday afternoon, and Sanchez was on Thursday morning trying to win over the Basque Nationalist Party, which has five seats and was due to make a final decision during the afternoon, when its leadership holds an extraordinary meeting.

The Basque party backed Rajoy's budget as recently as last week in parliament but is considering removing its support following a court ruling that sentenced dozens of people linked to the ruling People's Party (PP) to decades in prison in a long-running corruption trial.

Rajoy, whose minority government has struggled after two inconclusive elections in 2015 and 2016 ushered in the most fragmented parliament since democracy returned to Spain in the 1970s, is also coming under fire for a perceived inability to solve a secession crisis in the region of Catalonia.

Two Catalan pro-independence parties as well as leftist Podemos, a relative newcomer, another small Basque group and a party from the Canary Islands have said they would back Sanchez.

"The court ruling triggered a wave of indignation across the country. While families were suffering the crisis, you were becoming millionaires," Jose Luis Abalos, the member of parliament in charge of presenting the motion on behalf of the Socialists, told PP members in parliament at the start of the two-day debate.

Rajoy said on Wednesday he intended to serve his four-year term without calling an early election. But opposition parties are expected to continue to try to oust him even if Friday's vote fails.

Podemos and another newcomer, centre-right Ciudadanos, have said they were ready to present a new no-confidence motion with a candidate for Prime Minister whose brief would be to dissolve parliament and call a snap election.

The Spanish economy has so far appeared unaffected by political events. Gross domestic output grew by 3.0 percent on an annual basis in the first quarter, one of the strongest rises in the euro zone.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.