BARCELONA (Reuters) - Catalan separatist party Esquerra Republicana de Catalunya (ERC) reached a deal with Spain's Socialists (PSOE) to support acting Prime Minister Pedro Sanchez's bid for a second term, both parties said on Thursday.
However, the crucial backing of rival party Junts remains pending amid last-minute negotiations.
Sanchez, struggling to form a government three months after an inconclusive election, agreed a coalition deal with the left-wing Sumar last month but still needs support in parliament from smaller parties, including Catalan and Basque separatists, to win an investiture vote.
Seeking the support of the Catalan parties, Sanchez said on Saturday he favoured granting an amnesty to people involved with Catalonia's failed 2017 independence bid.
The potential amnesty has unleashed a political storm in Spain, with mainly conservative opponents holding large protests and accusing Sanchez of jeopardising the rule of law for his own political gain.
The agreement with ERC included "an amnesty for all", the Catalan party's chairman Oriol Junqueras told reporters, without elaborating.
It should include events from 2014 until now, said Pere Aragones, the ERC head of Catalonia's regional government, adding that after an amnesty it would be "time to advance towards" another referendum on self-determination.
Spain's Presidency Minister and PSOE senior official Felix Bolanos told reporters after sealing the deal with ERC that he would not give details about the amnesty while an agreement was still pending with other parties.
Junts held a meeting in Brussels to decide whether to back Sanchez's investiture, but it ended without an agreement with the PSOE, said a Junts source. Negotiations will continue on Friday.
Bolanos said the deal "guarantees stability for the legislature", suggesting it would also include votes on key pieces of legislation such as approval of the government budget.
But ERC leader Junqueras said continued support would depend on compliance with the agreement.
"It is a pact for the investiture, and as long as it is respected we will continue with our support," he said.
Under the agreement Spain will assume 15 billion euros ($15.9 billion) of Catalan debt, while creating a new mechanism that other regions could also use to seek market financing.
($1 = 0.9420 euros)
(Reporting by Emma Pinedo, Belen Carreno, Charlie Devereux and Joan Faus; editing by Charlie Devereux and Gareth Jones)