Emergency legislation “to protect Scotland’s devolved powers” has been passed by a margin of 95 votes to 32 by the Scottish Parliament.
“The new legislation will both protect the devolved settlement and prepare Scotland’s laws for the UK’s exit from the European Union,” said the Scottish government.
“The UK Withdrawal from the European Union (Legal Continuity) (Scotland) Bill will come into effect if the Scottish Parliament decides not to consent to the EU (Withdrawal) Bill and will prevent what ministers in Scotland and Wales have described as a ‘power grab’.”
The Welsh National Assembly has also passed similar legislation for devolved matters in Wales.
Michael Russell, the Minister for UK Negotiations on Scotland’s Place in Europe said: “The Scottish Government is opposed to leaving the EU in line with the overwhelming majority of people in Scotland, but we have a duty to prepare our laws for Brexit.
“However, Brexit must not be used by the UK Government as cover to grab powers from the Scottish Parliament and hand them to Westminster.
“I am delighted that the majority of the Scottish Parliament has come together to support devolution.
“The process of working through, and improving this bill, has been a credit to our national parliament and demonstrates the strength of feeling over this issue.
“The parliament has been clear that it could not recommend consent to the UK Government’s EU Withdrawal Bill, as it stands, as it allows the UK Government to unilaterally take control of devolved powers.
“We are still committed to discussions with the UK Government.
“We now expect them to acknowledge the overwhelming view expressed by the Scottish Parliament – and the Welsh National Assembly – and come forward with proposals that respect the devolution settlement and allow us to come to an agreement.”
A UK government spokeswoman said: “Our focus continues to be on finding an agreed way forward with the devolved administrations on the Withdrawal Bill.
“Everyone agrees this is the preferred option.
“As with all Scottish Parliament bills, the competence of the Continuity Bill will be considered by the Law Officers.”