Image copyright Reuters

The government is facing a legal battle over whether the UK stays inside the single market after it has left the EU, the BBC has learned.

Lawyers say uncertainty over the UK's European Economic Area membership means ministers could be stopped from taking Britain out of the single market.

They will argue the UK will not leave the EEA automatically when it leaves the EU and Parliament should decide.

But the government said EEA membership ends when the UK leaves the EU.

The single market allows the tariff-free movement of goods, services, money and people within the EU.

The EEA, set up in the 1990s, extends those benefits to some non-EU members like Norway, Iceland and Liechtenstein.

Non-EU members are outside the Common Agricultural Policy and customs union, but get barrier-free trade with the single market in return for paying into some EU budgets and accepting the free movement of workers.

If the courts back the legal challenge and give Parliament the final say over EEA membership, then MPs could vote to ensure that Britain stays in the single market until a long-term trading relationship with the EU has been agreed.

'Not automatic'

The pro-single market think tank British Influence is writing to Brexit Secretary David Davis to inform him that it will seek a formal judicial review of the government's position.

The group warned that if the government did not get a clear legal opinion it could potentially end up acting outside the law.

All EU member states are in the European Economic Area and it had been assumed that when Britain leaves the EU it would automatically leave the EEA as well.

But some lawyers argue that leaving the EEA would not be automatic and would happen only if Britain formally withdraws by triggering Article 127 of the EEA agreement.

The legal question is focused on whether the UK is a member of the EEA in its own right or because it is a member of the EU.

Is this good or bad news for the government?

If MPs do get to decide on Article 127, they could potentially overcome the government's small majority and keep Britain inside the single market after Brexit.

This would infuriate Brexiteers, but pro-EU campaigners say MPs would feel able to do this because people voted, they would argue, in the referendum to leave the EU and not the single market.

Paradoxically, though, the legal uncertainty over EEA membership could also end up being good news for the government.

If its negotiations with the EU went badly, and no deal looked likely, the UK could threaten to stay inside the EEA after Brexit. This would be politically hard for the government to sell as it would still involve EU workers moving freely within the UK. But it might be economically better than having to rely on World Trade Organisation rules which could involve high tariffs and barriers to trade.

The ability to stay on in the single market means Britain could force the EU into accepting a transitional period for the UK to avoid an economic cliff edge. This would be a useful stick for UK negotiators to have up as there appears to be no mechanism for the EEA to force out one of its members.

Professor George Yarrow, chairman of the Regulatory Policy Institute and emeritus professor at Hertford College, Oxford, said: "There is no provision in the EEA Agreement for UK membership to lapse if the UK withdraws from the EU.

"The only exit mechanism specified is Article 127, which would need to be triggered."

In other Brexit developments:

A pro-Brexit campaign group says it has abandoned plans for a demonstration outside the Supreme Court ahead of next week's Article 50 legal hearing. Leave.EU says it is concerned any protest could be hijacked by "far-right" elements

Campaigners urge the government not to "cherry pick" different parts of the economy for special trade agreements with the EU after Brexit

Polish Prime Minister Beata Szydlo, who is meeting Theresa May for talks in Downing Street later, wrote in the Daily Telegraph that she would be a constructive partner in Brexit negotiations but warned there would need to be compromise in the talks between the UK and EU

Eighty-one MPs and peers have signed a letter to European Council President Donald Tusk calling for a deal to protect the rights of both Britons living in other EU countries and EU nationals in the UK

At the the very least this latest challenge could mean a lengthy legal process - potentially via the European Court of Justice - that could delay Brexit negotiations.

If the courts say Article 127 does need to be triggered, there is the question of whether an act of parliament would be needed for it to be authorised.

'New wheeze'

The government is already fighting in the courts to stop MPs getting the final say over triggering the Article 50 process.

Downing Street said the UK was only party to the EEA agreement through its EU membership and the government's position was clear that "once we leave the EU we will automatically leave the EEA".

The PM's official spokeswoman said Theresa May was focused on delivering the will of the British people with regard to Brexit and preparing for the upcoming negotiations.

Conservative MP and Brexiteer Dominic Raab said: "Rather than coming up with new legal wheezes to try and frustrate the will of the people, these lawyers should be working with us to make a success of Brexit.

"The public have spoken; we should respect the result and get on with it, not try to find new hurdles that undermine the democratic process."