The UK government has launched a legal challenge to the Scottish and Welsh governments' Brexit bills.
The two devolved parliaments passed legislation last month that is intended to act as an alternative to Westminster's EU Withdrawal Bill.
But the UK government has asked the Supreme Court to rule whether the legislation is constitutional and within devolved powers.
Holyrood's presiding officer has already said he does not believe it is.
But Lord Advocate James Wolffe, the Scottish government's top legal advisor, argues the bill is competent, and recently took the unusual step of making an address to MSPs on this point.
He said the bill was "carefully framed so that it does not do anything or enable anything to be done, while the UK remains a member of the EU", and that it was "modelled, in this regard, on the UK government's EU Withdrawal Bill".
And Elin Jones, the presiding officer of the Senedd, has also ruled that AMs had the right to pass the legislation under their existing powers.
The UK Government's senior law officers, the Attorney General and the Advocate General for Scotland, have now confirmed they have asked the Supreme Court to rule on the issue.
Lord Keen, the Advocate General for Scotland, said: "By referring the Scottish Parliament's Continuity Bill to the Supreme Court, we are seeking legal certainty as to its competence.
"Given the presiding officer's view at introduction that the bill was not within the legal scope of the parliament, we believe it is important to ask the court to provide absolute clarity.
"In doing so we are following the process set out in the Scotland Act 1998. Particularly in the run up to Brexit, it is vital that we avoid legal uncertainty in our statute book."
The Scottish government brought forward the UK Withdrawal from the European Union (Legal Continuity) (Scotland) Bill as part of an ongoing row with UK ministers over post-Brexit powers, which has also seen the Welsh parliament pass its own legislation.
Ministers in Edinburgh and Cardiff are at loggerheads with those in Whitehall over how UK-wide frameworks of powers which are currently exercised from Brussels should be overseen.
Both sides agree these frameworks should be set up, but UK ministers want to have final oversight over some key areas in the short term - something the devolved administrations term a "power grab".
They want their consent to be formally sought over the running of these frameworks, while UK ministers have offered only to "consult" them.
The UK government has pledged to amend the EU Withdrawal Bill to settle the row, but with no sign of an agreement on the wording of this change, the devolved administrations brought forward their own legislation to act as a stop-gap should they ultimately not give consent to the Westminster bill.
The Holyood bill was rushed through on an emergency timetable, with MSPs sitting in marathon sessions to scrutinise the proposals - and voting to rein in some proposed ministerial powers.
Having been passed by MSPs four weeks ago, the bill had been scheduled to gain Royal assent in the coming days. Law officers moved to submit their formal challenge before this cut-off point was reached.
It was the first time that a government bill had passed in the Scottish Parliament without the presiding officer's blessing, after Ken Macintosh penned a lengthy memo arguing that it was not within the parliament's remit.
He said the bill could be competent after Brexit, but believes that at present it falls foul of EU law - saying it would see Holyrood "make provision now for the exercise of powers which is it possible [it] will acquire in future".
The Lord Advocate has made submissions on devolved competence around Brexit in the Supreme Court before, having argued in the Article 50 court case that Holyrood's consent should have been sought for the triggering of Brexit.
The justices unanimously rejected that argument, saying that the principle of legislative consent "does not give rise to a legally enforceable obligation".