After months of suspense, the Basque Nationalist Party (PNV) said in a statement it had “decided, out of a sense of responsibility, to vote yes to the budget” in a lower house vote Wednesday that drew applause from Prime Minister Mariano Rajoy and his ministers.
It will now go to the Senate where Rajoy's Popular Party (PP) has an absolute majority.
Approval of the budget was crucial for the survival of Rajoy's government until the next scheduled general election in 2020, according to analysts.
The PP lost its absolute majority in parliament over two years ago, forcing it into a difficult balancing act to obtain the support of centre-right party Ciudadanos and five small regional groupings like the PNV.
Rajoy welcomed the budget approval, saying it was “good for foreign investors, for (financial) markets” as well as ratings agencies.
He added the spending plan aimed to create more jobs in a country with a 16.5 percent unemployment rate and reduce inequalities after a severe economic crisis.
The PNV, which rules the northern Basque Country region, had for months threatened to withhold its support unless Madrid lifted its direct rule on Catalonia imposed last October after a failed secession bid.
Rajoy is not willing to give Catalonia back its autonomy after the region's new president Quim Torra named four jailed and exiled separatist leaders as part of his government unveiled last week.
The PNV, however, is deeply opposed to direct rule as it guards its own region's autonomy fiercely.
“We maintained this position until today because the situation has changed in recent days,” the Basque nationalists said in their statement.
Catalonia has a “legitimate president, elected by an absolute majority in parliament” and the end of direct rule in Catalonia “is very near”, they said.
The political situation in Catalonia remains blocked for now. Torra earlier on Wednesday called off the swearing-in of his administration because Madrid has refused to ratify the decree naming his ministers.
He announced he had asked his team to “study the legal measures that can be taken” to solve the impasse.
Madrid will only end its direct rule over Catalonia once a new regional government is in office.
While the PNV kept the suspense until the last minute, it was in its interest to see the budget approved. The PNV managed to persuade Rajoy to include a significant pension rise in the spending plan, indexing them to the inflation rate.
Tens of thousands of pensioners have taken to the streets of Spanish cities in recent months to demand higher pensions, with the protest especially large in the region governed by the PNV for most of the past four decades.
It also tweeted that it had obtained unspecified investments worth 540 million euros ($630 million) for the Basque Country.
'New scenario' in Catalonia
Now that Rajoy has secured passage of the budget, he can simply roll over the 2018 budget if he fails to get support for a new spending plan next year, observers say.
This guarantees that his government will last until the end of its term in two years' time.
Rajoy has kept a “low profile” on the Catalan question so as to “not jeopardise the PNV's vote in favour of the budget,” said Anton Losada, a professor of politics at the University of Santiago de Compostela.
“Once the budget is approved, this pressure will disappear, because he will be guaranteed to complete his term,” Losada, who has written a book about Rajoy, told AFP.
“We will enter into a new scenario in Catalonia where clearly the government could be more inflexible than it is right now,” he added.
By AFP's Mathieu Gorse