Professor Clara Ponsati, a St Andrews University academic, was arrested in March after handing herself in to police in Scotland.
It came after she was made the subject of a European Arrest Warrant, with the authorities in Madrid seeking her on charges of violent rebellion and misappropriation of public funds over her role in Catalonia’s controversial independence referendum in 2017.
A full extradition hearing lasting four weeks was set to get under way in Edinburgh at the end of this month.
However, on Thursday, a Spanish Supreme Court judge dropped the extradition request for the 61-year-old, an ex-Catalan education minister.
It came after a German court ruled last week that former regional president Carles Puigdemont could not be sent back to Spain for rebellion, only to face charges of embezzlement connected to alleged misuse of public funds for a referendum on secession.
The warrant was formally discharged during a short hearing on Monday at Edinburgh Sheriff Court.
Sheriff Nigel Ross told her: “As you know the arrest warrant from Spain has been withdrawn and therefore it just remains for me formally to discharge you from the European Arrest Warrant.
“You are free to go.”
Speaking outside the court, Prof Ponsati said: “I am just determined to keep fighting for the freedom of all political prisoners, for civil rights in Catalonia and Spain and for the Republic of Catalonia.”
In a statement, her solicitor Aamer Anwar added: “Today the arrest warrant for Clara was officially withdrawn.
“This is a humiliating defeat for the Spanish state which since 1 October has unleashed a wave of repression, attacking the Catalan people, suspending their government, jailing or trying to jail independence leaders.
“The Spanish state systematically used law as a weapon of war to try and eliminate their Catalan opponents, but they have persecuted not just politicians but also teachers, comedians, poets and rappers.
“The decapitation and liquidation of the Catalan government was the sole purpose of the European Arrest Warrant as Spain twisted and broke the law but in court after court across Europe Spain’s reputation has been damaged and ultimately the warrants were withdrawn for the fear of failure.
“On the first day that Clara appeared in court, we stated that we would put the Spanish judiciary ‘on trial’ within our courts, exposing them to the full glare of judicial scrutiny in our independent and robust courts. It was our intention to announce today that we would cite to court ex-ministers – prime minister Rajoy, deputy PM Sorayas Saez de Santamaria and the finance minister [Cristóbal] Montoro – as well as international human rights observers.
“This case was about Spain’s abuse of the judicial system to undermine the very principles they stand for: the rule of law, the sanctity of life, and the right to free speech.
“Clara, an esteemed university professor, if extradited faced up to 33 years for peacefully promoting a referendum.
“Clara would like me to thank her legal team, the people of Scotland, the UK, her fellow Catalans and Europeans as well as the SNP, the Green Party, the STUC, Scottish Government, Crowd Justice and the University of St Andrews who have given her such love and support.”