THERESA May is set to mount an unprecedented legal challenge at the UK Supreme Court next week to stop Nicola Sturgeon’s own Brexit Bill from becoming law.

Lawyers for the Prime Minister have been examining the Continuity Bills of both the Scottish and Welsh Governments, which seek to protect the devolved settlement in the event there is no agreement between London, Edinburgh and Cardiff on the UK Government’s flagship EU Withdrawal Bill.

The First Minister and her Welsh counterpart, Carwyn Jones, believe this is a “naked power-grab” by Whitehall.

READ MORE: Referendum split set to dominate SNP deputy race

Mrs May strongly denies this and insists more powers will be going to Holyrood and Cardiff Bay after Britain leaves the EU in March 2019. However, she wants a temporary hold put on some 24 powers and responsibilities so that common frameworks can be agreed to ensure the important UKwide internal market is protected.

The PM’s law officers have until next Wednesday to launch a legal challenge or face the Continuity Bills getting Royal Assent and becoming law. It is thought Jeremy Wright, the Attorney General, and Lord Keen of Elie, the Advocate General, Whitehall’s senior Scottish lawyer, will make the court application as early as Monday. A ministerial statement is expected to follow at Westminster.

Earlier this week David Mundell, the Scottish Secretary, said that a court challenge was “almost inevitable” but suggested it was “not a big deal” as it was just a legal process.

READ MORE: New referendum split surfaces among SNP MPs

However, the UK Government’s own bill has still to complete its parliamentary passage and Mrs May and Mr Mundell have until Tuesday May 8, the final day of Report Stage in the House of Lords, to get a deal with Ms Sturgeon and her colleagues as the Withdrawal Bill after this date goes to Edinburgh and Cardiff to get the consent, or not, of MSPs and AMs.

Officials from all three governments are said to have engaged in intense talks over Easter to try to resolve the constitutional impasse but so far without success.

Mr Mundell has insisted he expects the talks with the devolved administrations to go “down to the wire”. While he has repeatedly expressed confidence a deal with Edinburgh will be done, SNP sources have insisted Ms Sturgeon will not budge on what she regards as a matter of principle.

READ MORE: Yes supporters "turning in on themselves", Sillars admits

Yet some peers have even suggested that the second chamber, where the Government has no majority, could seek to block the legislation if there is no consent from MSPs and AMs.

If, for whatever reason, the EU Withdrawal Bill were blocked, then the legal challenge at the Supreme Court, set to take a number of weeks, would take on huge significance because if the UK Government lost, then the Continuity Bills would proceed to become law and the constitutional control over post-Brexit powers would shift from Westminster to Holyrood and Cardiff.