Spain's parliament is set to pass the national budget proposal for 2018 on Wednesday, giving the government of Prime Minister Mariano Rajoy some breathing space as it battles Catalan separatism.
Basque nationalist lawmakers have made a last-minute U-turn on their earlier promise not to support Rajoy's public spending plan as long as the ruling Popular Party remained in control in Catalonia.
The five votes of the Basque PNV party in the national parliament were needed to avert a major political crisis that would have exposed the weakness of Rajoy's minority administration, pushing him into a vote of confidence or even an early election.
The budget will take effect in June after it's passed by the Senate, where Rajoy's party holds a comfortable majority.
In exchange for its support, PNV had secured new investments and other benefits for the Basque regions, where it leads the governing coalition and has historically tried to widen areas of self-government.
It had also forced Rajoy's government to increase pensions, a priority issue for elderly voters and one that has sent thousands to the streets over the past months. The protests have drawn the largest numbers in the Basque city of Bilbao.
PNV had refused until Wednesday to support central authorities as long as Madrid kept in place its seven-month-long takeover of Catalan affairs in response to attempts by the region's separatists to break away from Spain. Both regions share high passions for self-determination.
In a statement posted on the party's website, PNV announced Wednesday that its support to the budget bill was an "act of responsibility" because it wanted to "avoid the abyss" of a national political crisis.