BARCELONA/MADRID (Reuters) -Spain's Supreme Court on Monday upheld arrest warrants for Catalonia's former leader and others charged with embezzlement over the region's failed secession bid, as it ruled that a recent amnesty law does not apply to them.

The decision could scupper the fragile Socialist-led coalition ruling Spain and have personal implications for ex-Catalan leader Carles Puigdemont, who is living in France in self-imposed exile.

Puigdemont's Junts party said it would appeal.

Its secretary-general, Jordi Turull, called the decision a "political decision that breaks the elemental norms of a democracy" and accused judges of staging a "coup" by trying to assume the legislative branch's role to torpedo the law's application.

An amnesty law passed on May 30 was meant to pardon those involved in the 2017 attempt to declare Catalonia's independence from Madrid in exchange for the critical support of separatist parties for Prime Minister Pedro Sanchez's new term after an inconclusive general election.

Investigating judge Pablo Llarena said in his writ he would continue to seek the arrest of Puigdemont and his former deputies Toni Comin and Lluis Puig, who were in charge of Catalonia's health and culture departments, respectively.

A withdrawal of support from Junts for bills such as the 2025 budget could leave Sanchez unable to govern and trigger new elections.

The amnesty does not apply to those who committed embezzlement with the intention of personally enriching themselves or if it affected the European Union's financial interests.

Llarena argued that the alleged conduct of Puigdemont, Comin and Puig "fully fits within the two exceptions contemplated in the law".

Llarena said they obtained personal gain by charging the expenses of holding an independence referendum deemed illegal by the Spanish judiciary to the regional treasury, a move he described as not being in the public interest.

All three say the referendum was not illegal and so the charges linked to it have no basis.

The referendum had also affected the European Union's financial interests, Llarena said, as Catalonia's secession would have impacted Spain's tax collection and gross national income.

The ruling is a blow for Puigdemont, who had appeared optimistic that the amnesty would fully clear all the accusations he faced in Spain, allowing him to return without the fear of arrest.

Despite the court decision, Puigdemont is still committed to returning to Spain the day the Catalan parliament elects the region's new leader following an inconclusive election in May, Junts said.

If the chamber has not chosen a leader by Aug. 26, a new regional election will be held in October.

(Reporting by David Latona, Joan Faus and Emma Pinedo; Editing by Charlie Devereux, Andrew Heavens and Sharon Singleton)

By Joan Faus and David Latona