Section 29(1) of the Scotland Act 1998 (the Scotland Act) provides that any Act passed by the Scottish Parliament will not be law so far as any provision of the Act is outside the legislative competence of the Parliament. Section 29(2) says that a provision is outside of the legislative competence of the Scottish Parliament if, amongst other things: it relates to matters which are reserved to the UK Parliament (including international relations); is in breach of the restrictions in Schedule 4 of the Scotland Act (which specifies provisions of enactments passed by the UK Parliament which cannot be modified by the Scottish Parliament); or is incompatible with European Union (EU) law. On 29 March 2019, the UK is due to withdraw from the EU. On 13 July 2017, the UK Government introduced the European Union (Withdrawal) Bill (the UK Bill) in the House of Commons, to repeal the statute which had taken the UK into the EU and to make provisions to achieve legal continuity within each of the UKs constituent jurisdictions. On 26 June 2018, the UK Bill became an Act (the UK Withdrawal Act). The UK Withdrawal Act amended Schedule 4 to the Scotland Act to include itself within the prohibition against modification. On 27 February 2018, the Scottish Government introduced the UK Withdrawal from the European Union (Legal Continuity) (Scotland) Bill (the Scottish Bill), to make its own provision for legal continuity following the UKs withdrawal from the EU. The Scottish Bill was passed by the Scottish Parliament on 21 March 2018. Section 17 of the Scottish Bill relates to subordinate legislation made by Ministers in the UK Government after withdrawal from the EU on matters of retained EU law which, if they were contained in a statute, would be within the legislative competence of the Scottish Parliament. The section provides that any such subordinate legislation will be of no effect unless the consent of the Scottish Ministers is obtained. Section 33 of and Schedule 1 to the Scottish Bill provide for the repeal of references to EU law and institutions of the EU in the Scotland Act. In accordance with section 33(1) of the Scotland Act, the Attorney General and the Advocate General for Scotland made a reference to the UK Supreme Court asking for a decision on whether the Scottish Bill is within the competence of the Scottish Parliament. The Supreme Court gives a unanimous judgment. It finds that the whole of the Scottish Bill would not be outside the legislative competence of the Scottish Parliament. However, section 17 would be outside the legislative competence of the Parliament because it would modify the Scotland Act and, at least in part, the sections referred to in the final paragraph below would be outside the competence of the Scottish Parliament because they would modify provisions of the UK Withdrawal Act. It is not for this Court to express any view on the question of which institutions of the UK should exercise the legislative powers currently held by EU institutions upon the UKs withdrawal. Instead, the role of the Court is 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 [11]. Is the Scottish Bill as a whole outside the legislative competence of the Scottish Parliament? The only relevant question is whether the Scottish Bill relates to relations with the EU (a reserved matter) [26]. To relate to a reserved matter, a provision must have more than a loose or consequential connection with it [27]. The Scottish Bill does not relate to relations with the EU. It simply regulates certain of the legal consequences of the cessation of EU law as a source of domestic law [33]. Is section 17 of the Scottish Bill outside the legislative competence of the Scottish Parliament? Under Schedule 4 to the Scotland Act, the Scottish Parliament does not have legislative competence to modify the Scotland Act [42]. An enactment is modified by a later enactment if it is implicitly amended, disapplied or repealed in whole or in part [51]. The UK Parliament has the power to authorise Ministers to make subordinate legislation, but the effect of section 17 would be to make the legal effect of such subordinate legislation conditional upon the consent of the Scottish Ministers. The imposition of this condition would be inconsistent with the recognition in section 28(7) of the Scotland Act that the UK Parliament has unqualified legislative power in Scotland. It would therefore have to be treated as impliedly amending (and thus modifying) section 28(7) of the Scotland Act [52]. Are section 33 of and Schedule 1 to the Scottish Bill outside the legislative competence of the Scottish Parliament? There is an exception to the rule that the Scottish Parliament does not have legislative competence to modify the Scotland Act, which allows the Parliament to repeal any enactment which is spent [69]. Spent means that the provision has no continuing legal effect [72]. The provisions which section 33 and Schedule 1 would repeal will not be spent until the UKs withdrawal from the EU [76]. However, the Scottish Ministers do not have power to bring section 33 into force until the UK has withdrawn, at which point the provisions to be repealed would have become spent [77]. As a result, section 33(1) and Schedule 1 do not breach Schedule 4 to the Scotland Act [79]. Are various provisions of the Scottish Bill outside the legislative competence of the Scottish Parliament because they (i) are incompatible with EU law, (ii) modify section 2(1) of the European Communities Act 1972 (ECA), and/or (iii) are contrary to the rule of law? None of the provisions which are challenged take legal effect until the provisions of EU law with which they are incompatible have ceased to have effect as a consequence of the UKs withdrawal from the EU. Without such legal effect, there is no incompatibility with EU law and no modification of section 2(1) of the ECA [84 85]. The challenge based on the rule of law is misconceived [86]. Can the Supreme Court consider the effect of the UK Withdrawal Act in the context of this reference? Yes, because the Courts task is to decide whether the Bill would be within the legislative competence of the Scottish Parliament if it received the Royal Assent at the time of the Courts decision [97]. What is the effect of the UK Withdrawal Act on the legislative competence of the Scottish Parliament in relation to the Scottish Bill? The UK Withdrawal Act is not a reserved matter but it is protected against modification under Schedule 4 [99]. Several provisions of the Scottish Bill in whole or in part amount to modifications of the UK Withdrawal Act. These are: section 2(2) [101]; section 5 [102]; section 7(2)(b) and 7(3) [103 104]; section 8(2) [105]; section 9A [106]; section 9B [107]; section 10(2), 10(3)(a) and 10(4)(a) [108 110]; section 11 [111 113]; section 13B, section 14, section 14A, section 15, section 16, section 19(1) and section 22 (to the extent that these provisions relate to section 11) [114 118, 120 121]; section 26A(6) [122]; and section 33 and Schedule 1 paragraphs 11(a) and 16 [123 124].