Spain's leftist minority government is managing a delicate balancing act to govern with the support of several smaller regional nationalist parties, including the heirs of the former political wing of armed Basque separatist group ETA.

The strategy has so far paid off for Socialist Prime Minister Pedro Sanchez, who first came to power in June 2018 and who has governed since January in coalition with far-left party Podemos.

He has in recent days secured enough support to get his 2021 budget plan through parliament.

Spain has since 2018 been functioning with a budget approved by the previous conservative Popular Party (PP) government of Mariano Rajoy.

Podemos negotiated support for the spending plan from Catalan separatist party ERC, Basque nationalist party PNV and Basque pro-independence party Bildu.

Bildu is seen as the heir to Batasuna, banned in 2003 for being the political wing of ETA which is blamed for the deaths of at least 853 people in its four-decade campaign of violence for an independent Basque homeland. ETA was formally dissolved in May 2018.

"This budget will be historic and the alliance even more," said Podemos leader Pablo Iglesias.

Sanchez took office in 2018 with the backing of these parties, prompting opponents to accuse him of forming a "Frankenstein government".

Already vilified by conservatives for forming a coalition with far-left Podemos, Sanchez has faced an outcry from the right over Bildu's support for his budget.

"Could you imagine (President-elect Joe) Biden making a pact with the terrorists who carried out the 9/11 attacks," said PP leader Pablo Casado.

Sanchez rejected the criticism, arguing Bildu's five lawmakers were "legitimately elected by Spaniards."

Prime Minister Pedro Sanchez and his deputy Pablo Iglesias presented the government's budget plan last month -- but they must rely on controversial allies
Prime Minister Pedro Sanchez and his deputy Pablo Iglesias presented the government's budget plan last month -- but they must rely on controversial allies LA MONCLOA / Borja Puig de la Bellacasa

Cristina Monge, a political scientist at the University of Zaragoza, said the alliances formed by Sanchez were risky but necessary in Spain's deeply fragmented parliament because "otherwise he will find himself without support" to pass legislation.

Sanchez wants to rely on the greatest number of possible partners in order to have "alternatives" and not have to pay an "excessive price" in terms of concessions to each party, she added.

Jorge del Palacio, a professor at the King Juan Carlos University, agrees, saying Sanchez wants to "maximise the possibility to count on everyone....so nobody can demand more than what he can give".

Monge said that getting the 2021 budget approved increases the chances that Sanchez will be able to govern until his current term in office expires in 2023 as he will be able to roll the budget from year to year.

The difficult talks over the budget have highlighted the divergences within Sanchez's coalition government, Spain's first since it returned to democracy in the 1970s.

Last week Podemos -- without warning the Socialists -- presented an amendment to the budget along with ERC and Bildu which would extend a ban on housing evictions until the end of 2022.

The Socialists initially rejected the amendment but promised to adopt it later on through a decree.

Amid a surge in migrant arrivals on Spain's Canary Islands, Podemos has also criticised the government's decision not to transfer migrants from the archipelago to mainland Spain as demanded by many campaigners.

Iglesias has also irritated the Socialists by backing calls for a referendum on independence in the Western Sahara, a former Spanish colony which was annexed by Morocco in 1975.

Since then it has been the subject of a long-running territorial dispute between Morocco and its indigenous Saharawi people, led by the Polisario Front.

His support for a referendum comes as Madrid is seeking Morocco's help to curb the flow of African migrants from its shores to the Canaries.

Defence Minister Margarita Robles warned Podemos that it can't "be in the government and the opposition at the same time."