THE former president of Catalonia, Artur Mas, goes on trial in Barcelona this week. He is charged with offences against the current Spanish Constitution. This document, adopted in 1978 as post-Franco Spain struggled towards democracy, legally enshrines “the indissoluble unity of the Spanish Nation, the common and indivisible homeland of all Spaniards”. The alleged crime of Artur Mas is to have challenged that “indissoluble unity” of the Spanish state by organising a Catalan independence referendum, for which offence he risks a 10-year ban from public office and a fine.

Mas is not the only elected supporter of Catalan independence facing prosecution, loss of office, fines and, for some, potential jail sentences. In an unprecedented move, the speaker of the Catalan Parliament, Carme Forcadell, is also being prosecuted by Spain’s Constitutional Court. Her alleged offence relates not to supporting independence per se but merely allowing the Catalan Parliament to vote on setting up an ad hoc committee to study making preparations for eventual independence. In addition, dozens of Catalan deputies and local mayors are under indictment for similar alleged offences against the constitution.

To its great credit, Spain made the painful transition to democracy after Franco’s death in 1976 and has successfully defused political violence in the Basque lands by offering unprecedented internal autonomy, including complete devolution of tax-raising powers to the Basque Parliament. So it is surprising that today Madrid appears on a collision course with the Catalan independence movement. A course that can only end in a political car-crash unless it is resolved – as it was in Scotland in 2014 – by a democratic vote rather than resorting to the law courts.

Flashback to November 2014, when Artur Mas’s devolved government in Barcelona organised a “consultative” referendum demanding independence for the historic Catalonia nation, now Spain’s richest region. I was there. The atmosphere was electric because no one knew if the Spanish Government in Madrid would order the police to close the polling stations. Ballot papers carried two questions: “Do you want Catalonia to become a state?” and “Do you want this state to be independent?” Some 2,305,290 votes were cast in an electorate of 5.4 million. Of those casting a ballot, 81 per cent supported the Yes-Yes option, another 10 per cent the Yes-No, and only 4.5 per cent the No option – there were also a lot of abstentions among those opposed to independence.

This vote, despite the abstentions, galvanised the Catalan independence movement. Catalonia went back to the polls in September 2015, this time to elect the 135-member regional government. Voter turnout was an unprecedented high of 75 per cent. A new coalition of pro-independence parties – JxSi (Together for Yes) – won 62 seats, just shy of a majority. But add in seats won by the pro-indy and left-wing CUP and the Catalan parliament has – for the first time since the fall of Franco – a clear majority in favour of independence.

Why this upsurge in support for Catalan freedom? Of course, Catalonia is an ancient, historic European nation – with its own language – that wants to recover cultural and social autonomy. But economics looms large in the reanimation of Catalan nationalism: ordinary Catalans feel they are being over-taxed by Madrid to pay for the implosion of Spain’s debt-ridden economy after the 2008 banking crisis. Equally, Madrid thinks it can’t let Catalonia go or risk losing Spain’s most economically dynamic area.

What happens next? It is very important to respect the fact that Spain is a quasi-federation that gives far more autonomy to its constituent regions and nations than we see here in the UK and Scotland. Had that not been agreed back in 1978, Spain faced a second civil war. On the other hand, the Spanish constitution enshrines an outright ban on contemplating, acknowledging, accommodating or agreeing to any overt move towards secession. That was the quid pro quo which reconciled old Franco supporters and the army to democracy. In other words, politically Spain is now between a rock and a hard place.

There are some who think that Spain’s right-wing Prime Minister, Mariano Rajoy, is using the Catalan crisis to build popular support in the rest of Spain for his minority government. It was Rajoy who was responsible for giving the Constitutional Court greater powers to fine or suspend officials who defied its edicts. Meanwhile, the court has been extending its interventions in Catalonia – at Madrid’s prompting. Last year the court overruled a ban on bullfighting in Catalonia, after Rajoy’s government argued the “sport” was part of Spain’s heritage and required nationwide protection.

Friends of Spain, as well as of Catalonia, can only suggest that the present crisis is best handled through dialogue rather than through the courts. I respect the fact that Spain has a constitution and that the law must be obeyed – especially by elected representatives of the people. However, no-one can deny the popular strength of feeling in Catalonia that wants to test the idea of independence in a democratic vote. Nor can it be denied that, as in Scotland, the Catalan independence movement has rejected violence and relies wholly on consent to achieve its aims. Equally, Catalonia cannot be kept inside the Spanish state by fiat or direction from Madrid. Wiser heads in Rajoy’s administration should be asking what happens if the legal process set in train leads to the political decapitation of the current, moderate Catalan leadership.

The solution, of course, is for Madrid to follow the example of the Scottish referendum and pass legislation to allow a Catalan referendum, whose result would be binding on all parties. What if such a move provoked a backlash from the far right? I accept the remote possibility. Yet it cannot be good for Spanish democracy to be held hostage by reactionaries. I also understand that no-one in Catalonia is being denied free speech or the right to advocate independence. Equally, charging so many public officials is potentially de-stabilising in itself.

Events in Catalonia are obviously of relevance to Scotland. If Catalonia votes for independence this September, it will clearly strengthen the case for a second Scottish referendum. Of course, Madrid’s extreme reluctance to contemplate Catalan secession has led to worries that Spain would block indy Scotland’s continuing membership of the EU. Indeed, Spain steadfastly refuses to recognise Kosovo’s breakaway from Serbia. But the latter was a unilateral declaration of independence. Spain has always been clear that if the UK agrees to Scotland’s independence that would our business. Besides, by the time of any Scots indyref2, Catalonia will have voted one way or the other.

The real importance of Scottish independence following hard on that of Catalonia is that it will transform the EU. A raft of small, dynamic new members could end the dominance of the bigger states and replace the EU’s current austerity with pro-growth policies. A new Europe of the regions and nations would emerge as a global progressive alternative to Donald Trump’s aggressive American nativism or the isolationist lunacy of a Tory hard Brexit. Even for the remaining constituent nations and regions of Spain, such a reinvigorated European project offers great advantages.