The Spanish government’s handling of the Catalonian independence movement is worse than a human rights outrage; it is a mistake.

The trial of a dozen separatist leaders on charges including “rebellion” and “sedition”, charges carrying sentences of up to 25 years in prison, ought to be unthinkable in country that is an established member of the European Union and a signatory of the European Convention on Human Rights.

From the beginning, from the confrontational way in which the Spanish police handled peaceful demonstrations in Catalonia, the authorities in Madrid have got this wrong. They responded to the attempts by the devolved parliament in Barcelona to seek independence with a heavy-handed refusal to respect free expression and democratic, non-violent demands.

The independence movement has not always handled its campaign in the most effective way. The unofficial referendum held in October 2017 was not a good mandate, and the parliament’s declaration of its independence a few weeks later was unwise.

But the central government’s response has been disgraceful. The charges brought against the leaders of the independence movement are plainly political and the long detention of those accused is unjustifiable. It ought to prick the conscience of all Spaniards and indeed all good Europeans that Carles Puigdemont, president of the putative breakaway republic, felt he had to flee the country.

Protests as Catalan leaders face trial: in pictures Show all 13 1 /13 Protests as Catalan leaders face trial: in pictures Protests as Catalan leaders face trial: in pictures Pro-union protesters demonstrate outside the Supreme Court in Madrid Reuters Protests as Catalan leaders face trial: in pictures A separatist protester holds a sign reading "When injustice becomes law, rebellion is a must" outside the Supreme Court in Madrid AFP/Getty Protests as Catalan leaders face trial: in pictures Separatist protesters hold a banner reading "Nationalism is supremacy" outside the Supreme Court in Madrid EPA Protests as Catalan leaders face trial: in pictures A protester holds a Catalan pro-independence Estelada flag during a protest outside the Supreme Court in Madrid AFP/Getty Protests as Catalan leaders face trial: in pictures A separatist protester holds up a banner during a protest outside the Supreme Court in Madrid Reuters Protests as Catalan leaders face trial: in pictures Basque people hold a sign reading "you will never walk alone, we are with you. Basque Country is always with Catalonia" outside the Supreme Court in Madrid AFP/Getty Protests as Catalan leaders face trial: in pictures Protesters hold banners mocking the trial of jailed Catalan separatists outside the Supreme Court in Madrid AFP/Getty Protests as Catalan leaders face trial: in pictures Separatist protesters hold up signs and banners during a protest outside the Supreme Court in Madrid Reuters Protests as Catalan leaders face trial: in pictures Separatist protesters hold Catalan and Spanish Republican flags and a banner reading "deciding is not a crime" outside the Supreme Court in Madrid Reuters Protests as Catalan leaders face trial: in pictures Pro-union demonstrators hold a sign depicting former President of the Catalan Government Carles Puigdemont reading "Puigdemont not ours" outside the Supreme Court in Madrid Reuters Protests as Catalan leaders face trial: in pictures Pro-union demonstrators hold Spanish flags with the message "hooray for the unity of Spain" outside the Supreme Court in Madrid EPA Protests as Catalan leaders face trial: in pictures Catalan regional president Quim Torra (C-R) and Catalan regional parliament speaker Roger Torrent (C-L) take part in a protest against the trial of jailed Catalan separatists in Madrid AFP/Getty Protests as Catalan leaders face trial: in pictures The president of Catalonian Parliament, Roger Torrent, center, and the Catalan regional President Quim Torra walk with protesters holding a banner that reads "to choose is not a crime" outside the Supreme Court in Madrid AP

For a non-violent political dissident to have to seek exile in another EU country – Belgium – is a stain on Spain’s membership of a union supposedly committed to the protection and furtherance of human rights.

What makes Tuesday’s court proceedings in Madrid so controversial is that, if the defendants are found guilty, they are bound to appeal, eventually to the European Court of Human Rights, where their right to peaceful expression of their views is almost certain to be recognised.

However, even if the Spanish national authorities refuse to accept that they are on the wrong side of human rights law, Pedro Sanchez, the Spanish prime minister, should realise that this is not the best way to defeat demands for Catalan independence.

We British should resist the temptation to lecture other nations on how to manage national and regional differences within states, but there is something to be learned from the way David Cameron dealt with demands for Scottish independence. He accepted the right of a people to govern themselves, and sought to persuade them in a democratic campaign that they should remain part of the larger union. The idea of making Alex Salmond, first minister of Scotland, a martyr by jailing him was never a remote possibility.