Assuming that everything goes according to plan, the United Kingdom will be leaving the European Union in just a few months.

But Brexit will not happen in a political vacuum.

Student or retired? Then this plan is for you.

The European Union has been central to the defence and promotion of democracy, and Brexit might be detrimental to this essential role (Photo: Magnus Fröderberg/Norden.org)

On the contrary, the first withdrawal of an EU country from the block will take place in a moment of extraordinary difficulties for liberal democracies.

The symptoms of the malaise are well known not just to specialists but also to the general public: processes of rule of law backsliding in Hungary and Poland, the rise of illiberal and populist forces in many Western countries, authoritarian strongmen on the global stage, and a US president that disregards America's traditional partners and values.

There are many good reasons to think that Brexit will be a bad thing, from the economic difficulties it might create to the loss of rights of citizens.

But here is one additional cause for concern, which often goes unnoticed: the European Union has been central to the defence and promotion of democracy in Europe and the world, and Brexit might be detrimental to this essential role.

In effect, criticisms about the so-called EU's democratic deficit often obscure the important contribution of the Union to democracy and human rights.

Democratisation of new candidates

In Spain, my country, the prospects of joining the European communities played an important role in pushing forward democratisation when the dictator Franco finally died. That was also the case of other southern, central and eastern European countries.

Democratic conditionality for accession still plays a role in the democratisation of new candidates to joining the Union.

Additionally, the treaties of the European Union mandate the promotion of democratic values in the foreign action of the bloc.

The European Union also protects democracy within its borders.

While the range of tools available to the Union - particularly the rule of law mechanism of Art.7 TEU - sometimes seem insufficient to fully prevent the deterioration of democracy in some of its member states, it is worth thinking about the counterfactual: a situation in which authoritarian leaders of EU member states did not have to fear any pressure or prospects of sanctions for violating the basic rules of liberal democracy.

Such a scenario would probably look much worse than the current one.

The United Kingdom has had the opportunity to contribute to these functions of democracy protection and promotion from within the European Union.

The potential for such a British contribution should not be under assessed, given the status of the UK as an economic and diplomatic power.

Seen from a British perspective, the European Union offered the United Kingdom the tools to protect values that are at the core of the best version of Britishness: liberal democracy and human rights.

After Brexit, this will be more difficult.

In this regard, Brexit will be simultaneously detrimental to the European Union and the United Kingdom, because it will undermine the capacity of both actors to protect the values that they uphold, even if only because it might make coordination in defence of these values more difficult.

Post-Brexit democratic partnership

As a response to this challenge I recently published a policy paper with Elcano Royal Institute, a Madrid and Brussels based think tank.

In that work, I defend the need for a post-Brexit EU-UK democratic partnership to palliate the detrimental effects of Brexit on democracy protection.

Modelled as a more ambitious version of the EU-Canada strategic partnership agreement (Ceta), the EU-UK democratic partnership would involve a number of arrangements and tools through which both actors could continue to effectively protect and promote democracy in Europe and in the world.

In particular, the democratic partnership would involve a continued funding commitment in support of democratic forces all over the world by both the EU and the UK.

It would also involve a reciprocal commitment to protect and promote democratic values in foreign policy by both parties, which would include foreign policy coordination through regular meetings.

And it would involve institutionalised forms of cooperation through which the UK could support the efforts of the EU to protect the rule of law in its own member states, as a complement for the rule of law mechanism.

This democratic partnership between the UK and the EU could be open to other democratic forces in Europe.

Moreover, mimicking the Ceta, the democratic partnership could make economic cooperation between the parties conditional to respect by both the UK and the EU of the basic rules of liberal democracy and human rights.

Future generations

Brexit is bad news for democrats in Europe, and good news for authoritarian actors all over the world.

However, imaginative solutions can reduce the problems posed by a British exit from the European Union in the field of democracy protection and promotion.

The European Union and the United Kingdom share the same values, and both parties have talked frequently about their future partnership, but so far there has been little discussion about how they will cooperate to defend democracy.

This is a paradox, as democracy protection is probably the most important and urgent task of our time.

British and EU negotiators are still on time to address this issue.

If they do so, implementing some sort of democratic partnership, they will be making a decided step in the protection of their shared world-view, and in the protection of the rights of present and future generations of citizens both sides of the channel.

Pablo Castillo Ortiz is a lecturer in EU law at the University of Sheffield in the UK