The Supreme Court in England has ruled that parts of a Brexit bill passed by the Scottish Government would be outside its legislative powers.
Seven justices unanimously held today that, although the Scottish Bill "as a whole" is not outside Holyrood's powers, the parts of it which would "modify" UK law would be.
The court's president Lady Hale said: "We wish to make it clear that it is no part of our function to determine or to influence the political questions which underlie this dispute.
"Our role is a purely legal one."
Lady Hale explained that the Scottish Bill "provides for the continued validity in Scots law of retained European Union law" and was passed in March, before the UK's EU exit bill.
Law officers were able to refer the bill to the court before it received Royal Assent, so the court could rule on whether it would be within the legislative powers granted to the Scottish Parliament by the Scotland Act.
The judge said Section 17 of the bill - which was successfully challenged by the law officers - had the effect of modifying part of the Scotland Act as it would "render the effect of laws made by the UK Parliament, conferring powers on UK ministers in relation to Scotland, conditional on the consent of the Scottish ministers.
She also said that the UK Parliament's European Union (Withdrawal) Act "changes the legal landscape" and is "protected from modification".
Lady Hale said this prevents the Scottish Bill from "amending, superseding, disapplying or repealing provisions of that Act", and said, therefore, parts of it would be "outside the legislative competence" of Holyrood.
In the ruling, the justices said: "Withdrawal from the EU will result in legislative powers, which are currently vested in EU institutions, being transferred to institutions within the UK.
"There has been and is a political debate as to which institutions within the UK should best exercise those powers in the public interest.
"It is not the role of this court to form or express any view on those questions of policy, which are the responsibility of our elected representatives and in which the wider civil society has an interest.
"Our role is simply to determine as a matter of law whether and to what extent the Scottish Bill would be within the legislative competence of the Scottish Parliament."