The decision by the Catalan parliament to declare independence from Spain is the latest in a long chain of misjudgements on both sides.

The leaders of the Catalan independence movement are playing games, hoping that by escalating the conflict with an unwisely confrontational central government in Madrid they will increase support for their notional republic. If it works, it would only be by causing conflict and tension that is not in the interest of the peoples on either side of the border between Catalonia and the rest of Spain.

There are only two peaceful routes to sustainable independence for Catalonia. One would be what might be called the Scottish route: to work towards a referendum by agreement with the central government in Madrid, in which both sides would respect the outcome. Sadly, that option has not been possible, partly because the Madrid government is too influenced by the history of the Civil War (in which demands for Catalan independence played a part on the Republican side) and by the more recent experience of fighting Eta terrorists seeking Basque independence (whose violence alienated most of the Basque population).

The only other peaceful route to independence would be to demonstrate overwhelming, sustained and resolute support for it among the Catalan population. The unauthorised referendum organised on 1 October by the Catalan government suggested that this condition has not been met. The referendum was boycotted by most supporters of Spanish unity, and secured a 92 per cent vote for independence on a 43 per cent turnout. This means that just under 40 per cent of the electorate supported independence. This is higher than the 37 per cent of the British electorate who voted to leave the European Union, but the test in a disputed referendum is more stringent. Who knows what the outcome would have been in a referendum agreed with the central government, in which both sides campaigned and the result of which both sides undertook to respect?

In any case, support for independence is one thing; support for a unilateral declaration of independence is quite another. If support for independence is unclear, opinion polls suggest that there is a majority against a unilateral declaration among Catalans.

Carles Puigdemont, the would-be president of an independent Catalonia, has got ahead of himself. Some of the questions about independence can be hard to resolve in advance, as Alex Salmond and the Scottish National Party discovered in 2014. But the SNP had better answers about currency and relations with the rest of the EU than Mr Puigdemont has now. One pressing question that may seem trivial but which is of great cultural importance is what would happen to FC Barcelona, one of the greatest football clubs in Europe?

It was striking, too, that the Scottish government, led by Mr Salmond’s successor Nicola Sturgeon, said it “understands and respects” the position of its Catalan counterpart, but stopped short of recognising Catalonia as an independent country.

Both sides need to pull back from confrontation. The Madrid government must recognise that it will defeat the separatists only by respecting the free democratic will of the Catalan people. If the central government is to maintain Spanish unity and stability, it needs to offer dialogue and legitimate options short of independence.