IF Scotland in 2014 was Project Fear, what is Catalonia today? In just a few weeks we’ve seen ballot papers seized, newspapers suppressed, rubber bullets fired and parliaments shut down, with national leaders fleeing the country under threat of sedition charges, all under the approving eyes of the European Union. If the British state used fear, the Spanish state has deployed skin-searing terror to bring its rebellious province into line. Day by day, as if readying itself for Hallowe’en, Madrid has been ramping up the horror.

Outside of Spain, mainstream opinion is caught between two urges. Morally, while the EU, the UK and the Spanish social democrats have abandoned all sense of decency, there’s otherwise a widespread sense of repulsion at Rajoy’s behaviour, which has a disagreeable jackboot smell that makes even the most apologetic liberals squeamish. But this is commonly balanced by immediate concessions to Rajoy’s narrative: the referendum was illegal, the Catalan leaders are inept, etc.

This confusion should be addressed immediately. The referendum was illegal, yes, provided we accept one important condition. It’s illegal if you believe that Spain’s constitution cancels out the most basic principle of international law, article 1(2) of the United Nations charter, concerning the right of nations to self-determination.

By this logic, almost every independence movement in history is illegal, because most were forced to break with the constitutional norms of the time, often violently. If we accepted it, the number of states in the world would be tiny. Dominant states – and clubs of states, like the EU – do not like breakaways and do everything possible to suppress them: they only allow referendums when a) they are backed into a corner or b) they are ultra-confident of winning and humiliating secessionists. This is one reason why international law exists and, nominally, overrides domestic law.

This puts the EU in a difficult position, of course. “Understanding claims for secession and autonomy does not mean acceding to them: authoritative legal referendums are the method enshrined in international law to test such claims – and it is a disgrace that the EU and Spanish state have refused one in Catalonia,” notes Paul Mason. “But in December the European Court of Justice ruled that article 1 of the UN charter, which guarantees the right of self-determination to states that are not yet independent, is a legally enforceable right in the EU.”

I have emphasised this to stress a point: there’s a danger of making a fetish of legality. Appeals to the oracle of legal process can hardly take precedence when the main Madrid parties have closed off every lawful channel for resolving the question. Yes, it’s illegal, but only because Madrid considers Spain legally indivisible and has thus by definition denied Catalonia’s potential nationhood and right to self-determination. If we take international law seriously, that’s also illegal. More importantly, it’s unjust.

When a law is unjust, there are very basic, thoroughly mainstream grounds for civil disobedience. It’s not only Martin Luther King and Malcolm X who stressed our moral duty to confront dishonourable laws with resistance. Even impeccably white canonical liberals are agreed on this. “If a law is unjust, a man is not only right to disobey it, he is obligated to do so,” said Thomas Jefferson. A referendum is a peculiarly peaceful and democratic form of civic resistance by the standards of Gandhi, never mind the American Revolution.

Nonetheless, even the most generous would admit that the Catalan movement has found itself in a dicey situation. Having fled the country, the parliamentary leaders are now effectively a government in exile. There are social, economic and political barriers on the path to a peaceful conclusion. Big business opinion is opposed to secession, as it was in Scotland. Madrid’s brutal, violent crackdown has emboldened reactionary Spanish nationalism, inside and outside of Catalonia. Many other citizens are terrified and just want a peaceful conclusion, no matter what.

Meanwhile, Carles Puigdemont and many in the Catalan movement have misjudged the international picture. Like the Scottish Government, Puigdemont’s party is economically liberal, pro-business and pro-European, and has staked a great deal on the EU’s honourable intentions towards smaller nations. They’ve been resoundingly disabused of these illusions in past weeks. As with so many situations, the EU’s preference for big power players is glaringly obvious here.

Catalonia cannot depend on the top-down internationalism of the EU. Brussels has taken a clear, bold position in favour of the reactionary government in Madrid, and seems barely willing to call for restraint in the use of violent force. But the movement cannot ignore international opinion either. To win a victory, Catalonia needs support from us: an internationalism from below, a set of alliances that we build independently of Theresa May or Jean-Claude Juncker.

That’s why Catalonia’s crisis might be our opportunity. Genuine internationalists have been faced with choosing between racist populism and uncritical obedience to top-down, free-market international clubs. To combat the suppression of Catalonia, we’ve got to overcome this dualism by building an alliance of Europeans who want radical democratic control of the continent. This is truly a battle for the meaning of democracy in Europe, and it demands our immediate attention, not tomorrow, but right now.