Talks to avert a constitutional crisis over devolution of powers after Brexit will enter their final 24 hours today with a deal said to be awaiting sign off from First Minister Nicola Sturgeon.

Officials were last night trying to agree arrangements for a final face-to-face meeting between ministers from the UK, Scottish and Welsh administrations with a view to striking a deal before a deadline tomorrow.

First Minister Nicola Sturgeon has defended the safety of the baby boxes

The final draft of an amendment to the devolution provisions of the EU Withdrawal Bill must be tabled by tomorrow in order to be voted on by the House of Lords at the start of May.

Months of talks have so far failed to resolve how powers in devolved areas returning from Brussels after Brexit will be distributed between London, Edinburgh and Cardiff.

UK ministers have said powers in around 25 areas including agriculture and fisheries must be “frozen” at Westminster to prevent regulations in different parts of the UK diverging after Brexit, putting internal trade at risk and ­complicating agreements with other countries.

But the two devolved governments have condemned the EU Withdrawal Bill as a “power grab”, saying they are willing to reach agreement on joint control of certain areas only if the powers reside at Edinburgh and Cardiff.

Unless changes can be agreed to the EU Withdrawal Bill, which will transfer EU law into UK statute on Brexit day, both devolved governments have threatened to refuse their consent for the legislation.

Edinburgh and Cardiff have already passed Continuity Bills, which assert their authority over the contested powers, in a direct challenge to Westminster.

Last week the UK government began legal action against the devolved governments at the Supreme Court over these Continuity Bills.

Labour and Liberal Democrat peers have also threatened to vote against the EU Withdrawal Bill unless it gets backing from the devolved administrations, putting the government’s entire Brexit legislative programme at risk.

Even if the three governments can agree on the principle of where the powers will end up, months of negotiations lie ahead on creating frameworks to regulate areas of joint authority.

Over the weekend, UK and Scottish officials are believed to have reached an outline deal including fresh assurances from Whitehall about how devolved powers will be “frozen”, and how devolved governments will be consulted.

However, it is understood this latest offer was rejected by the First Minister. Welsh ministers are understood to be ready to reach an agreement and are awaiting a deal between London and Edinburgh.

There were no confirmed plans last night for a meeting of the Joint Ministerial Committee (JMC) on European Negotiations today. A meeting could still go ahead this evening or tomorrow.

A UK government source said talks were entering “injury time” and an amendment to the Withdrawal Bill would be tabled tomorrow regardless of whether a deal is reached.

The last-ditch efforts came as Theresa May insisted the UK must leave the customs union after Brexit in order to strike trade deals around the world.

The Prime Minister is facing a series of parliamentary battles in the coming weeks, with pro-European Conservative MPs set to voice their concerns over withdrawal from the customs union in a symbolic vote on Thursday.

Downing Street denied suggestions that the issue could be turned into a vote of confidence in the government.

Speaking during a local election campaign visit, Mrs May insisted should would not change course. She said customs arrangements would be as “frictionless as possible” with the EU while retaining the ability to strike trade deals around the world.

On a visit to a firm in the West Midlands she said: “Coming out of the customs union means that we will be free to have those deals, deals that suit the UK. But I also recognise the importance to businesses like this of being able to have as frictionless a border as possible into the European Union.”

Downing Street insisted the government’s position had not changed since Mrs May delivered her Mansion House speech in March. Those plans included two options, either a “customs partnership” – effectively collecting duties for Brussels for goods arriving in the UK but intended for EU markets – or a “highly streamlined” arrangement making use of technology and regulatory co-operation.

But Mrs May is set to face calls from leading Brexiteers to abandon her preferred form of customs deal, according to reports. A showdown is expected to come at a meeting of the Cabinet Brexit committee scheduled for today.