Theresa May has said that Britain will not have left the European Union if it is not in control of its laws.
Photograph: Emmanuel Dunand/AFP/Getty Images

Since the UK voted to leave the EU, Theresa May has tried to boil down arguments over Brexit to simple soundbites. One of the favourite phrases deployed by the prime minister and her team is that the UK will “take back control” from Europe – over money, over borders and over laws.

In a speech in January laying out the government’s negotiating stance, May was clear on the legal dimension of departure. Brexit would see the UK making a clear break from the jurisdiction of the European court of justice (ECJ), the Luxembourg-based guardian and interpreter of EU law, as it leaves the single market and customs union.

“We will not have truly left the European Union if we are not in control of our own laws,” she said. “Leaving the European Union will mean that our laws will be made in Westminster, Edinburgh, Cardiff and Belfast. And those laws will be interpreted by judges not in Luxembourg, but in courts across this country.”

More recently Brexit secretary David Davis threw in his own analogy, saying the EU could not be allowed to “pick the referee” in legal disputes between the UK and EU, post-Brexit. “If Manchester United played Real Madrid, you would not let Real pick the referee,” he said.

Nothing delights hardcore Brexiters in the Tory party more than promises to end what is often referred to as the “meddling” of EU judges in the British legal system and way of life.

In popular eurosceptic mythology the ECJ has come to be seen as the ultimate symbol of supranational authority, of power seeping away from these shores to Brussels as the EU tries to become a state in its own right. It is also often confused with the non-EU, Strasbourg-based European court of human rights which famously, and hugely controversially, held up the deportation of Abu Qatada, prompting public outrage in Britain.

May’s pledges to halt the UK’s budget contributions to Brussels, terminate free movement for EU citizens and leave the single market have carried wide popular appeal among those who back Brexit. But among anti-EU purists at Westminster the issue of legal sovereignty and the role of the ECJ – which makes the laws and ultimately is where power lies – has long been the most totemic in the Conservative party. Breaking away from the court is the eurosceptics’ holy grail.

As a result, for May, whose cabinet has spent much of the summer in bitter arguments and deepening confusion over how to deal with Brexit, it is now emerging as the most nightmarish problem of all.

In recent weeks ministers have wrangled over how far and fast to put their foot down on the Brexit pedal. Slowly, amid louder and louder warnings from business, the dangers of too hard a Brexit have begun to dawn.

The language of breaking free, erecting hard borders, refusing to pay a euro to Brussels, turning our backs on the single market and customs union, has given way, uneasily, to some acceptance of the need for a more gradual approach, and for transitional arrangements to avoid a cliff-edge plunge into a potentially ruinous unknown in 2019.

Last week ministers issued the first of a series of Brexit papers, supposedly to clarify the government’s position on the UK’s future relationship with the EU customs union, and the devilishly difficult matter of the border between Northern Ireland and the republic, before a critical phase of negotiations with Brussels opens later this month.

While the papers raised as many questions (and arguably more) than they answered, two things were clear: the UK is still set on leaving the single market and customs union but wants to stay as closely linked to both as it possibly can; and it wants to avoid any form of hard border between the republic and Northern Ireland. But how?

This week ministers will release several more position papers, including one on proposed mechanisms “for enforcement and dispute resolution once the European court of justice no longer has direct jurisdiction in the UK”. Legal experts see real problems ahead – a stark incompatibility between the desire to stay close to the EU in trade and customs, while breaking free from European rules and regulations that govern the single market and customs union.

Sir Paul Jenkins, who for eight years before 2014 was head of the government legal department and its most senior legal official, told the Observer: “If the UK is to be part of something close enough to a customs union or the single market to remove the need for hard borders, it will only work if the rules are identical to the EU’s own internal rules. Not only must they be the same, but there must be consistent policing of those rules.”

Steve Peers, professor of law at the University of Essex, added: “The idea that a close link with the EU can be combined with a complete break with the ECJ is simplistic. It’s the judicial version of ‘have our cake and eat it too’.” Peers maintains, however, that a compromise is possible, but it will require ministers to shift ground.

“Brexit ministers should spell out that although they are opposed to the ECJ’s current role of [for instance] asserting the supremacy of EU law over UK law, they can accept the kind of indirect or informal ECJ role that other non-EU countries have agreed to in the past.”

Writing for the Observer, Catherine Barnard, professor of EU law at Trinity College, Cambridge, says May may well find that escaping the court’s jurisdiction is impossible.

But it could be worse than that, because while failing to escape its reach, the UK will also lose influence at the court, which will no longer contain a British judge after Brexit. According to Barnard, contrary to the impression that the ECJ has always tended to make judgments against the UK national interest, it has often done the reverse.

On crucial legal issues, as with so much else in the Brexit debate, ministers are finding that breaking free from the EU while remaining closely involved – and retaining its benefits – is not an easy balancing act to pull off.