THE Westminster Parliament will be able to proceed with today’s Commons decisions on the deal agreed with the European Union by Prime Minister Boris Johnson after a last-minute attempt to halt the debate was defeated in Scotland’s top civil court.

Jolyon Maugham QC, director of the Good Law project, lodged the petition at the Outer House of the Court of Session in Edinburgh, saying that the deal was unlawful and should not be considered by Parliament. He sought court orders to effectively halt the proceedings in Parliament.

The legal challenge suggested that that the proposed deal breaches UK law by leaving Northern Ireland in a separate customs arrangement to the rest of the country, contrary to section 55 of the Taxation (Cross-Border Trade) Act 2018.

READ MORE: Johnson says Brexit deal 'busts' UK out of Northern Ireland backstop

The section states: “It shall be unlawful for Her Majesty’s Government to enter into arrangements under which Northern Ireland forms part of a separate customs territory to Great Britain.”

Giving judgement in favour of the UK Government Lord Pentland stated: “In my opinion, the petitioner does not have a prima facie case.

“In the first place, the petition is of very doubtful competency. The orders sought would unquestionably interfere to a major extent with the proposed proceedings in Parliament. Suspension of the draft withdrawal agreement would mean that the motion for its approval could not realistically or properly go ahead as planned.

"I cannot see that it would be right for Parliament to be invited to consider a draft treaty which the court had suspended on the basis that it was unlawful.

"It is a cardinal principle of constitutional law that the courts should not intrude on the legitimate affairs and processes of Parliament. I consider that it should be left to Parliament to proceed in relation to the draft withdrawal agreement in the manner and according to the procedures that Parliament considers most appropriate in the circumstances."

Counsel for Maugham, Aidan O’Neill QC had told the court: “What we have before us is a void agreement that has been presented publicly and to Parliament as valid.

“The agreement which was presented yesterday is void; is of no effect as a matter of law. If the interim suspension is granted on the basis that the agreement as a matter of national law is void, then there’s no agreement which can be laid before the House.”

READ MORE: Brexit: Eleventh-hour bid to ensure Boris Johnson obeys law fails

Gerry Moynihan QC for the Government, described the legal challenge as a “direct and manifest interference with Parliament” and revealed the House of Commons Speaker’s counsel had written to both parties urging them not “inhibit” bringing a matter before Parliament.

Moynihan said suspending the agreement would prevent the deal being brought before Parliament, acknowledging the Government would not be able to claim a deal had been done or agreed if the court ruled the agreement unlawful.

“It would be utterly futile to lay a copy of that non-agreement before the House,” he said.

“It is a gross intrusion into the separation of power,” he said of the legal challenge, which he claimed was “simply incompetent”.

He also argued Northern Ireland would remain in the UK’s customs territory because “a substantial part” of trade would still be with the UK.

Lord Pentland wrote in his judgement: “The petitioner has placed nothing before the court by way of evidence, averment or oral submission to show that in future Northern Ireland’s trading and customs arrangements will not qualify and fall to be treated as amounting to a 'customs territory' in the manner envisaged in the draft Protocol.

"The clear intention underlying the draft Protocol is that Northern Ireland will remain part of the customs territory of the United Kingdom. There is nothing to show that this will not play out as intended and work in a satisfactory manner.

"The fact that there will also be trade between Northern Ireland and the EU on which customs duties shall be payable does not necessarily infer that Northern Ireland cannot at the same time be part of the customs territory of the United Kingdom.

"A substantial part of Northern Ireland’s trade will still be with Great Britain and will not be subject to customs duties."

After the judgement was issued, Maugham, who joined SNP MP Joanna Cherry in the successful challenge against the prorogation of Parliament, tweeted: “That was a difficult decision to make. It is difficult to move quickly and accurately and, the court has found, I got that decision wrong."