AFTER four days and more than 20 hours of, at times, impenetrable evidence, the mother of all constitutional legal battles is over.

The historic Brexit legal challenge has drawn to a close with a reminder from the Supreme Court President Lord Neuberger that its ruling would not "overturn the result of the EU referendum" but, rather, the case had focused on "the process by which that result can lawfully be brought into effect".

The nub of the matter is: where does power lie; with the executive or the legislature?

Read more: Constitutional battle now between PM's Brexit and the "Tartan Remain," says Pete Wishart

James Eadie QC for the UK Government told the court rights related to EU membership were created and taken away "on the international plane" rather than by domestic legislation so a new Act of Parliament was not required for Brexit; Theresa May could, therefore, use so-called prerogative powers.

But Lord Pannick QC, acting for Gina Miller, the investment manager who brought the original case, insisted: "The law of the land is not altered by a motion in Parliament. This is a basic constitutional principle." It could, he argued, only be changed by an Act of Parliament.

James Woolfe QC, the Lord Advocate, insisted Scotland deserved a “voice” in the process given that withdrawal from the EU would have significant consequences for the devolved settlement; that if the judges determined a new law was needed at Westminster, then the Sewel Convention should apply. This says that Westminster does not normally legislate with regard to devolved matters without Holyrood’s consent.

Read more: Constitutional battle now between PM's Brexit and the "Tartan Remain," says Pete Wishart

Lord Keen QC, the Advocate General, argued Westminster was sovereign and the Sewel Convention was just that, a political convention, which could be ignored. In any case, foreign affairs was not devolved but reserved to Westminster.

At times, the case became a symposium on semantics. What, for example, does “normally” actually mean? Ditto for “with regard to devolved matters?”

Of course, the political significance of the legal challenge has elevated the constitutional case.

The court battle has opened up deep emotions. When the High Court ruling was made, the tabloid press branded the judges “enemies of the people”. Ms Miller has been subjected to vile abuse and even death threats.

Politics cast a shadow over the final day of the court hearing after MPs voted overwhelmingly to back the Prime Minister’s timetable to trigger Article 50 by the end of March.

Adding to the political pressure, Iain Duncan Smith, the leading Brexiter, warned the judges that if the Supreme Court ruled against the UK Government, then it would risk a “massive constitutional clash”.

But if the court went further and accepted Mr Woolfe’s argument, then it could hand Holyrood an effective veto.

Read more: Constitutional battle now between PM's Brexit and the "Tartan Remain," says Pete Wishart

Yet, having argued the Sewel Convention is just a political device and not legally binding, then any Holyrood vote could be overridden.

Any such action by Mrs May would unleash an almighty constitutional clash, the outcome of which could be profound.