The dramatic events that have shaken Catalonia and the Spanish state have national and international implications.
The decision of the Spanish government - led by the right-wing PP government under Prime Minister Mariano Rajoy - to implement Article 155 of the constitution and end the autonomy of Catalonia, is an attack on the democratic rights of the Catalan people and a threat to workers in the entire Spanish state.
The brutal attacks by the Spanish Civil Guard on those who went to vote in the referendum on 1 October left over 900 injured and provoked international outrage among working people.
Such scenes are a warning of the repression that will be turned on workers and young people throughout the Spanish state if they struggle to fight to defend their interests.
This repression illustrates the character both of the PP and the Spanish state machine. Following the transition from the Franco dictatorship in 1978 there was no purge from the state machine of its fascist elements.
The legacy of this remains today throughout the state apparatus. Even the PP itself was originally founded by six ministers from Franco's fascist government.
In a threat of a return to real methods of the dictatorship, one senior PP spokesman even raised the question of banning political parties and organisations which oppose 'Spanish unity'!
The Spanish ruling class will not tolerate a threat to its interests which would flow from allowing Catalan independence.
It could also pose the threat of the Basque country breaking away from the Spanish state. Fear of such a development has also terrified the capitalist class throughout the EU, especially following Brexit.
The international representatives of capitalism have revealed breathtaking hypocrisy in their response to the crisis.
While many have been critical of the 'overreaction' by Rajoy, which has only inflamed the crisis further, they have also demonstrated hypocritical double standards.
The EU has dubbed it a 'Spanish affair' - an internal matter for a member state in which it will not intervene.
Macron in France, Merkel in Germany and May in Britain have all refused to oppose Rajoy's government, despite fearing the consequences that may flow from its actions.
Yet the Financial Times in its editorial on 20 October had no problem demanding the EU intervene in Venezuela and impose sanctions following the recent local elections which saw a certain rallying in support for the Maduro regime against the right-wing opposition.
The reaction of the Rajoy government has undoubtedly increased support for independence within Catalonia.
Before the attacks on those trying to vote in the referendum and prior to the enacting of Article 155 it was unclear if a majority in Catalonia supported independence.
Some of the most combative workers and certainly the youth did and support for it had been growing. But the attempts of the Rajoy government to deny the Catalan people the democratic right to decide swelled their ranks.
Over one million took to the streets in Barcelona on 3 October in support of independence and in opposition to Rajoy's threats! Socialists have a responsibility to support the right of self-determination and the right of the Catalan people to hold a referendum to decide their future.
A struggle for a socialist republic of Catalonia could become part of a struggle to defeat the Rajoy government and to fight the austerity policies his government in Madrid is implementing, as well as those implemented by the conservative Catalan government led by PDeCat and Catalan president Puigdemont.
This would not be a struggle against the peoples in the rest of the Spanish state. Socialists fight for the unity of all working peoples.
A socialist republic of Catalonia could be the basis to forge a united struggle of working class people throughout the Spanish state to oppose the PP government, defend democratic and national rights, and oppose austerity and capitalism.
On a voluntary and democratic basis such a struggle would open the way to establish a voluntary, democratic, socialist federation of Catalonia and all those in Spain, Galicia and the Basque country, which would defend the democratic and national rights of all its peoples.
This could be a bridge to appeal to workers and young people in Greece, Portugal and the rest of Europe to come together and form a voluntary democratic socialist federation of Europe as an alternative to the EU and its pro-capitalist policies.
The de facto coup by the Rajoy government and the repression it has implemented, including the arrest without bail of two leaders of the independence movement, needs to be opposed by the mass movement in Catalonia and throughout the Spanish state.
The calling of a two-day general strike by the Sindicat d'Estudiants (students' union in Catalonia - see below), which was subsequently backed by the Catalan nationalist student unions too, shows the way. A general strike of all workers in Catalonia needs to be built.
In this struggle no trust or confidence should be given to the capitalist class of Catalonia or their political representatives.
Over 1,000 Catalan companies have now moved their headquarters out of Catalonia as they ally themselves with the Spanish ruling class in Madrid.
As in all struggles to defend the right of self-determination, no trust can be placed in the capitalist class.
As in the struggles in the neocolonial countries against imperialism the ruling classes, tied and enmeshed with the interests of imperialism, are incapable of leading a struggle against the imperial powers to win genuine independence.
This task falls to the working class and those exploited by imperialism and capitalism. There is an element of this involved in this struggle of the Catalan people for self-determination against Rajoy's PP government in Madrid.
PDeCat and Puigdemont have been no friends of the Catalan working class and have mirrored the austerity policies implemented by Rajoy in Madrid.
One reason Puigdemont has opposed new elections in Catalonia is that PDeCat would probably lose support to more left radical parties like the CUP.
Unfortunately, the radical anti-capitalist, pro-independence CUP, has propped up the PDeCat government rather than strike out and fight to build an independent socialist mass movement of the workers and youth to oppose the ruling class in Catalonia.
The ex-social democratic Psoe, which has lost over half its votes since the economic crisis of 2007-08, has played a lamentable role throughout this crisis and has acted in cahoots with Rajoy's repressive measures.
The former defence minister in the last Psoe government called for the arrest of all the Catalan leaders of the independence movement, adding: "When there's a drink driver in charge, you have to stop the car and arrest the driver".
Psoe will pay a heavy price for this - the party's death warrant in Catalonia has been signed.
While left party Podemos has opposed the policies of the Rajoy government, it has not turned its words into deeds with a clear call to action either in Catalonia or in the rest of the Spanish state.
At the time of writing it remains unclear how the struggle will develop due to the failure of the left socialist forces and trade unions to lead a mass, independent struggle.
However, the crisis is set to continue providing big opportunities for the working class of Catalonia and the whole of the Spanish state to build an alternative that can struggle for a socialist republic of Catalonia as a part of voluntary democratic socialist federation of all the peoples of the Spanish state.
The Socialist Party, and its Committee for a Workers' International sister parties in the Spanish state (Izquierda Revolucionaria) and across the world will play an important role in the future battles which are certain to unfold.
The Sindicat d'Estudiants (SE, Catalan students' union) is calling for a two-day general strike on 25 and 26 October of all students in protest against the repression of the Spanish state and declaration of Article 155.
They are calling on teachers' and education workers' unions to support the strike, making it a general strike of the whole education sector.
At the time of writing, the call has had a great impact. Other important Catalan student organisations - the left-nationalist students' union SEPC and the 'Universities for the [Catalan] Republic' organisation - have backed the SE's call to strike on 26 October and supported the Barcelona demonstration called by the SE on the morning of the strike.
This strike is a key development, putting the question of workers' strike action on the agenda and stressing the necessary leading role of the working class in the fight against national oppression and for a socialist Catalonia.
SE wants its strike to function as a lever to help turn the whole workers' movement towards a general strike.
SE's general strike on 28 September against repression was massive - over 150,000 took part in the morning demonstration - and played a key role as a lever to build for the historic Catalan general strike on 3 October.
Esquerra RevolucionÓria, the Socialist Party's sister organisation in Catalonia, plays a leading role in the SE.
This version of this article was first posted on the Socialist Party website on 24 October 2017 and may vary slightly from the version subsequently printed in The Socialist.
Above, video recorded on the 26 October 2017, discussing the situation in Catalonia with Tony Saunois, Committee for a Workers International.