Theresa May has urged the Scottish Government to reconsider its opposition to key Brexit legislation in the wake of “considerable changes” by the UK Government.

With Welsh ministers having now agreed a compromise deal over the EU Withdrawal Bill, Mrs May said it was “disappointing” that ministers at Holyrood had not followed suit.

She spoke on the issue after Brexit Secretary David Davis revealed to MPs that last ditch talks were taking place to secure the consent of the Scottish Government to the Bill.

The devolved administrations in Scotland and Wales had been working together to prevent a “power grab” after the legislation set out plans for some responsibilities to be returned to Westminster – instead of Edinburgh or Cardiff – so common frameworks could be put in place across the UK.

New amendments from the UK Government will introduce a “sunset clause” so that devolved powers returned to Westminster do not stay there indefinitely.

Despite ministers in Wales now agreeing to consent to the Withdrawal Bill, the Scottish Government has stood firm in its objection, saying Holyrood’s powers could be restricted for up to seven years by the UK.

Mrs May said she was “pleased” her government had secured the agreement of ministers in Cardiff, hailing it as a “significant achievement” after months of wrangling.

The Withdrawal Bill will “increase the powers of the devolved governments and respect the devolution settlements,” the Prime Minister said.

Mrs May said: “We have made considerable changes to the Bill to reflect issues raised by members and by the devolved administrations. It is indeed disappointing that the Scottish Government have not yet felt able to add their agreement to the new amendments and we sincerely hope they will reconsider their position.”

Earlier Mr Davis told MPs on the House of Commons Exiting the EU Committee that talks were still going on with the Scottish Government.

He said: “I was slightly disappointed we didn’t get agreement with the Scottish Government. I thought we got quite close.

“The Welsh Government have essentially agreed with the changes we have proposed and we are still talking to the Scottish Government, and we will be up until five o’clock this evening, when the last possible time for laying the amendment is.

“I hope we can find a mechanism for getting agreement between us still.”

SNP MP Joanna Cherry warned it was  now “a very real possibility” that the Scottish Parliament would not give its formal consent to the EU Withdrawal Bill.

She went on to raise fears that “the UK Government could simply ignore the issue of consent and ride roughshod over the wishes of the Scottish Parliament and proceed”.

While this would not stop the UK Government from bringing in the legislation, it raises the prospect of a deepening rift between Westminster and Holyrood if the Bill has to be forced through against the wishes of MSPs.

It comes after Scottish Brexit Minister Mike Russell told MSPs on Tuesday the “key sticking point” in reaching a deal was “clause 11 and the insistence of the UK Government on its right to take control of devolved powers”.

Welsh Finance Secretary Mark Drakeford said that “London has changed its position so that all powers and policy areas rest in Cardiff, unless specified to be temporarily held by the UK Government”.

He added: “These will be areas where we all agree common, UK-wide rules are needed for a functioning UK internal market.”

But Liz Saville Roberts, leader of the Welsh nationalist Paid Cymru party in the Commons, said: “For the first time since the birth of devolution the Westminster Government has succeeded in clawing back powers which should be held by our national assembly.”

She added: “This will have major consequences for the UK’s constitution, and this is all thanks to the Labour Party in Wales.”

Scottish Conservative constitution spokesman Adam Tomkins said the deal with Wales left the Scottish First Minister “alone and isolated in her belligerence” to the Bill.

He said on Twitter: “Delighted that agreement has been reached between UK and Welsh Govts on legislating for Brexit compatibly with devolution. Unsurprised that the wretched SNP would rather manufacture further grievance than get on board with the deal. A good day for the UK; a bad day for the SNP.”

After the UK Government published the amendments, Mr Russell said the document showed it would “make it easier than ever before for the UK Government to constrain the Scottish Parliament and undermine devolution”.

He added: “This bill allows the UK Government to prevent the Scottish Parliament legislating to protect farmers, our fishing communities, the environment, and a range of other devolved policy areas for up to seven years.

“It is now crystal clear in terms never seen before that the Scottish Parliament can be over-ridden by the UK Government – not just on the withdrawal bill, but on a range of Brexit issues.

“It is now for those who believe we should accept these amendments to set out why they are happy to allow the Scottish Parliament to be undermined in such a way.

“We will continue to talk with the UK Government to see if a solution can be agreed. That can either be a removal of clause 11 so that all the governments of the UK proceed on the basis of trust and agreement or the EU Withdrawal Bill can be amended so that the consent of the Scottish Parliament is required before the powers of the Parliament can be constrained.”