Campaigning in Catalonia’s 21 December regional election begins officially on Tuesday. Opinion polls show pro- and anti-independence political parties running neck and neck. But the outcome will shape the future not just of Catalonia and Spain but of other European nations and EU institutions.

This election was triggered by the Madrid government after it enacted article 155 of the Spanish constitution in October – an unprecedented move that led to the formal suspension of the region’s autonomy. Spain’s prime minister, Mariano Rajoy, hoped this would help him to gain time, while working to dampen secessionist feeling, including by floating ideas about an enhanced version of Catalan autonomy for the future. Now things are set to accelerate again. More, not less, political turmoil could lie ahead.

The political battle comes with a legal one. On Monday a Spanish supreme court judge will decide whether to release Catalan cabinet members so that they can run in the election. The ministers are currently in custody accused of sedition, rebellion and misuse of public funds, all of which they deny. Pro-independence activists have launched a “yellow-ribbon” campaign in support for what they describe as political prisoners.

Yet it is the authorities in Madrid who are worried about a martyr effect if they are not released. The Spanish government’s response to the 1 October referendum proved popular outside Catalonia but was seen as provocative and heavy-handed by Catalans. Perhaps in an attempt to indicate flexibility, Madrid has since adopted a more cautious approach to the way article 155 is implemented. Although the central authorities have taken control of Catalonia’s finances, for example, they have refrained from closing down or directly running its regional radio and television.

Meanwhile the ousted Catalan president, Carles Puigdemont, has sought refuge in Brussels with four of his former ministers. The move has divided his sympathisers. Some depict it as a case of forced exile, others as a flight from responsibility. Mr Puigdemont cuts something of a lonely figure now. He has been badly frustrated by the lack of support from European leaders. He has suggested that Catalonia should vote to break away from the “decadent” EU – a statement that divides opinion in a region where attachment to the EU is strong. Many Catalans are worried after thousands of companies announced they would relocate outside the region.

Madrid’s attitude is unpopular in Catalonia. Yet Catalan public opinion is fragmented and polarised, not united, on what course to follow. Support for and opposition to independence cuts across left-right divides. Catalan groups close to the Spanish progressive Podemos movement oppose independence but want a legal and binding referendum that Madrid would honour. Yet it is not clear whether this might be on offer. The centrist Ciutadans (Citizens) movement has gained in the polls with a promise to prioritise social justice policies and to move beyond the independence issue, a reminder that these elections are not a simple binary choice and that the outcome will depend on coalition-building.

Catalan radicals talk about historic aspirations that were crushed under Franco and are again in danger. A more immediate reality is that Catalonia’s post-Franco regional autonomy now needs to be firmly re-established and strengthened. This month’s vote is a key test for Catalan and Spanish democracy. The campaign must unfold freely, lawfully and peacefully and the outcome must be respected. Dialogue and compromise remain good options. The next three weeks will show if they are realistic.