Holyrood 'must be respected' over Brexit
Not consulting the Scottish Parliament on Brexit would "bypass an important constitutional requirement", Scotland's top law officer has argued.
Lord Advocate James Wolffe was speaking on the final day of the four-day Supreme Court hearing in London.
He said the case was about "who has the power to change the law of the land".
And he said convention "constrains" the UK Parliament in the exercise of its legal powers in Scotland in order to respect the authority of Holyrood.
The lord advocate started his submission to the 11 Supreme Court justices on Wednesday afternoon, and concluded on Thursday morning.
He is arguing that the Scottish Parliament needs to be consulted before the UK can begin the formal process of leaving the EU.
But the UK government does not believe it is necessary to ask either the UK or Scottish Parliaments, and wants to trigger Article 50 by using existing ministerial powers - the royal prerogative.
It is appealing to the Supreme Court against a High Court ruling that MPs must be given a vote before Article 50 can be invoked. A judgement is expected to be delivered in January.
Act of Union
The lord advocate told the court: "Fundamentally I say this case is about who has the power to change the law of the land.
"In Scotland there are three legislatures - the United Kingdom Parliament, the European legislator, and there is the Scottish Parliament.
"Convention constrains the United Kingdom parliament in the exercise of its legal powers in order to respect the authority which the Scottish Parliament has."
The law officer also said it would have been "extraordinary" if the Act of Union between Scotland and England had intended to give the Crown the power to change the laws of Scotland.
He added: "The question of who had authority as regards Scots Law was a matter of significance to the framers of the Union legislation.
"I say it is not a matter simply of footnoting to note that the power to change the laws of Scotland was given to parliament, and of course to those whom parliament authorised, and not to the Crown.
"That is consistent with what I say is the limiting rule of constitutional law, that sets bounds to the use of the prerogative and precludes the United Kingdom government from asserting the power to make the significant changes to the laws of the land by virtue of the prerogative that they tried in this case."
Addressing the Supreme Court on Tuesday, the UK government's Attorney General for Scotland, Lord Keen, said the Scottish government's case was "fatally undermined" by the fact it does not have powers over foreign affairs.
Lord Keen also said it was "perfectly clear" that the royal prerogative applies in Scotland, Wales and Northern Ireland as well as England and its use is a matter for the UK government.
He added: "All foreign relations and foreign affairs, in particular all our relationships with the EU, are not within the competence of the devolved legislators.
"There is no means by which you can suggest the exercise of the foreign affairs prerogative is in any way impinged or qualified by devolution legislation."