Holyrood has shown it will be “resolute in defending devolution” by backing emergency Brexit legislation amid a row with Westminster, Brexit Minister Mike Russell said.

In an unprecedented move, MSPs approved legislation brought forward by the Scottish Government which the Parliament’s Presiding Officer has previously ruled to be outside of its competence – although SNP ministers insist they have “no doubts” in this area.

The legislation was brought forward by SNP ministers during the ongoing row with Westminster over the return of devolved powers from Brussels once Britain leaves the EU.

The UK Withdrawal from the European Union (Legal Continuity) (Scotland) Bill was approved by 95 votes to 32 shortly after the Welsh Assembly passed similar legislation.

Ministers in both Cardiff and Edinburgh have repeatedly branded the UK Government’s EU Withdrawal Bill a “power grab” which threatens devolution.

As MSPs debated the legislation at Holyrood, Mr Russell stressed both he and First Minister Nicola Sturgeon still wanted to reach an agreement with the UK over changes to its Bill.

Mr Russell said such a move “would send an important signal – it would show that devolution would be properly respected, it would acknowledge the constitution under which we live, it would show that the different governments of the UK can sit down and negotiate to reach a mutually acceptable outcome”.

He added: “It would show that this way of doing business, rather than imposition, should be the norm.

“I remain hopeful an agreement can be reached. The First Minister, the Deputy First Minister and I have all made clear that is our first objective, and we will do our best to achieve it.

“But passing this Bill would be an important sign that the Parliament is resolute in defending devolution.”

The UK legislation, which would see some devolved powers go initially to Westminster to allow UK wide frameworks to be established, is an attempt by Tory ministers to “turn the clock back to 1973 and allow the UK Government and it alone to redesign devolution, as if the UK had never been in the EU, Common Market or European Community”, Mr Russell said.

“It was clear at the outset that this position was never going to get the agreement of any devolved administration worth its salt.”

Tory constitution spokesman Adam Tomkins challenged the Government to refer the Bill to the Supreme Court, so the UK’s most senior judges could rule on its competence, saying there were “grave doubts” about this.

But Mr Russell said the Government “has no doubts that the Bill is competent”, insisting that was “absolutely clear”.

The Tories were the only party in Holyrood to oppose the legislation – although one Lib Dem MSP also voted against it – with Mr Tomkins describing it as “bad law” which sought to “sow the seeds of division within the United Kingdom”.

The Conservative MSP said: “This Bill is unwelcome and it is unnecessary. We have resisted it at every stage of its process and we will vote against it.”

With the Bill having gone through its entire parliamentary process in just over three weeks, Labour Brexit spokesman Neil Findlay said many MSPs were uncomfortable at how it had gone through Holyrood at “breakneck speed”.

Mr Findlay said: “Members across the chamber have tried their level best to make this messy Bill better, but we should not easily forget that it is the Tories who have gotten us into this mess and time is running out for them to get us out of it.”

A UK Government spokeswoman said: “Our focus continues to be on finding an agreed way forward with the devolved administrations on the EU (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.”