A LEGAL bid to persuade Scotland’s highest civil court to declare Boris Johnson’s new Brexit deal unlawful will be decided later this afternoon.

Campaigner Jolyon Maugham QC wants the Court of Session in Edinburgh to suspend the agreement between the EU and UK on the basis that it “provides for Northern Ireland to form part of a separate customs territory to Great Britain”.

He is also seeking an interim interdict – similar to an injunction – to stop UK ministers from entering into such arrangements.

Judge Lord Pentland said he will make his ruling by 5pm.

Mr Maugham argues the new deal contravenes a current law stipulating it is "unlawful for Her Majesty's Government to enter into arrangements under which Northern Ireland forms part of a separate customs territory to Great Britain".

This part of the Taxation (Cross-border Trade) Act 2018, Section 55, was put forward by the Conservatives' right-wing group of MPs known as the European Research Group (ERG).

Mr Johnson has insisted his agreement removes the "anti-democratic" Irish backstop, which aimed to avoid a hard border on the island of Ireland.

Meanwhile, the EU's chief negotiator Michel Barnier said Northern Ireland would be part of the UK's customs territory, but would "remain an entry point" into the EU single market and aligned to some EU rules on goods.

But Aidan O’Neill QC, acting for Mr Maugham, said the new Brexit deal is a "void agreement which has been presented publicly and to Parliament as if it were a valid agreement".

He said the legal reality is it would mean Northern Ireland remaining part of the EU customs territory, which would be in breach of UK law.

And he insisted the Brexit deal represents an "unlawful action on the part of the UK Government", adding: "It can't be plainer than that."

However, Gerry Moynihan QC, for the UK Government, said the legal action is inviting the court to "inhibit" parliamentary consideration of the Brexit deal.

He branded it a "manifest attempt to interfere with proceedings in Parliament", and “fundamentally incompetent”.

Legal advisers of Commons Speaker John Bercow also wrote to both parties to insist the “courts should not make any order which would inhibit the bringing of any matter before Parliament”.

Lord Pentland said the legal action is very unusual in that it "involves the court becoming quite closely involved" in how Parliament handles its business.

Mr O’Neill said the petitioner is simply seeking to ensure Parliament and parliamentarians are "fully advised" of the legality of what they do.

It comes after the Prime Minister and European Commission President Jean-Claude Juncker announced the two sides had reached a Brexit deal on Thursday, ahead of a crucial EU summit in Brussels.

EU leaders then approved the deal, and MPs are expected to vote on it on Saturday.

Mr O'Neill said Westminster could potentially repeal the law which currently prevents Northern Ireland being part of any different customs arrangements to the rest of the UK.

He added: "Parliament is the supreme and sovereign body, it can - if so advised - pass or vote on legislation which would repeal the relevant provision: Section 55 of the Taxation Act.

"It could retrospectively validate the agreement that has been reached. All this court can do is apply the law as it currently stands."

Speaking outside the Court of Session, Mr Maugham said: "Having heard the arguments of the Government, it remains my view - and clearly my view - that the Withdrawal Agreement is unlawful."