A left-wing Catalan party that holds the balance of power after the Spanish elections could insist on an independence referendum and an end to the prosecution of separatist politicians as the price of its support.

Spanish prime minister Pedro Sanchez’s centre-left Socialist Workers’s Party (PSOE) topped Sunday’s contest but needs the support of smaller parties to govern because it did not win an absolute majority.

But Republican Left of Catalonia (ERC), which topped the vote in its region to win 15 seats, said that while it was willing to cooperate it would not write a “blank cheque” for Mr Sanchez.

“The question is not what ERC will do with the PSOE, but what the PSOE will do with Catalonia,” Gabriel Rufian, the ERC’s deputy leader in the congress told Catalunya Radio.

“We will ask for a negotiation that brings together all the forces, that discusses a referendum and laws in order to lift the case against the separatist comrades.”

The Spanish government has been refusing to hold an official independence referendum for Catalonia, despite a popular separatist movement winning control of the region’s local government.

After the Catalan administration held a referendum of its own and unilaterally declared independence in 2017, Spain’s Supreme Court ruled that the move was illegal, and issued orders for the arrest of many pro-independence politicians.

One such politician imprisoned for his role in the declaration of independence is Oriol Junqueras – the president of the ERC party the socialists must now try and do a deal with.

Mr Sanchez is likely to seek the support of Spanish leftist group Podemos but would need the support of at least one smaller regional party to get near an actual majority. PSOE, Podemos and ERC together would give any government a narrow majority to pass budgets.

Demonstrators hold banners reading ‘Democracy’ during a pro-independence rally at Barcelona University Square (EPA)

Alternatively the socialists could try to rule as a minority, looking for support in votes on an ad hoc basis. While it is relatively easy for minority governments to gain power under Spain’s constitution, Mr Sanchez was already forced to call the snap election after regionalist parties refused to back him and his old government in a key vote.

Far-right Vox party celebrate gains in Spain election: in pictures Show all 9 1 /9 Far-right Vox party celebrate gains in Spain election: in pictures Far-right Vox party celebrate gains in Spain election: in pictures A supporter of Spanish far-right Vox party chants "long live Spain" in a closing event for the election campaign on April 26 AP Far-right Vox party celebrate gains in Spain election: in pictures Vox leader Santiago Abascal reacts as the election results are announced AFP/Getty Far-right Vox party celebrate gains in Spain election: in pictures Vox leader Santiago Abascal speaks at a rally on election night AFP/Getty Far-right Vox party celebrate gains in Spain election: in pictures Supporters of Vox wait for the announcement of the election results in Madrid Reuters Far-right Vox party celebrate gains in Spain election: in pictures Supporters of Vox wave flags as leader Santiago Abascal delivers a speech on election night AFP/Getty Far-right Vox party celebrate gains in Spain election: in pictures Supporters of Vox celebrate following the election results in Madrid AFP/Getty Far-right Vox party celebrate gains in Spain election: in pictures Supporters of Vox wait for the announcement of the election results in Madrid Reuters Far-right Vox party celebrate gains in Spain election: in pictures Supporters of Vox wait for the announcement of the election results in Madrid Reuters Far-right Vox party celebrate gains in Spain election: in pictures Vox leader Santiago Abascal reacts as the election results are announced Reuters

Carmen Calvo, Spain’s deputy prime minister, said on Monday morning that “the PSOE will try a government alone” – suggesting the socialists would not formally bring other parties into their administration but instead work out and arrangement for confidence votes.

Coalitions with other groups, such as the esoteric liberal nationalist Citizens Party, appear to be off the table. That party’s leader, Albert Rivera, said during the campaign he would not do a deal with the socialists and has already declared himself “leader of the opposition”.