The UK Government has referred Brexit legislation passed in the Scottish Parliament to the Supreme Court.

The UK's highest court will decide whether the emergency legislation, which was passed at Holyrood last month, is constitutional.

Scottish ministers said the UK Withdrawal from the European Union (Legal Continuity) (Scotland) Bill is a necessary backstop to safeguard devolution as the UK leaves the EU.

The UK government has launched a legal challenge, saying the bill risks causing legal uncertainty during the Brexit process.

It is the first time the legal competence of Scottish Parliament legislation has been challenged in the Supreme Court.

Similar legislation passed at the Welsh Assembly will also be referred to the Supreme Court.

The Scottish bill was passed despite presiding officer Ken Macintosh stating the Scottish Parliament did not have power to legislate on the matter.

Advocate general for Scotland Lord Keen 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."

Ivan McKee MSP, who sits on Holyrood's Constitution Committee, said: "Scotland's Parliament made its voice clear, passing the Bill by 95 votes to 32.

"And yet, the Tories still, arrogantly, think they alone have the right to strike it down.

"The Tories have no mandate but think they can do whatever they want to Scotland and get away with it - and this legal challenge proves it.

"They opposed devolution in the first place, they've consistently voted against Scotland's interests and now they want to clip Holyrood's wings once again."

He said Scotland's most senior law officer, the Lord Advocate, had ruled that the bill was competent and the Conservatives were seeking to undermine devolution.

Mr McKee continued: "We're being dragged out of Europe and out of the single market at a huge cost to jobs and our economy.

"In that context, the devolution settlement itself has come under sustained attack from the Tories.

"That underpins the case for a stronger Scottish Parliament, not this latest cynical attempt by Westminster to put Scotland back in its box."