The UK’s highest court will rule on a challenge brought over Brexit legislation passed by the Scottish Parliament.

Supreme Court justices will announce their decision on Thursday on the “competence” of the Scottish Bill following a hearing in London in the summer.

The court has been asked to rule on whether the EU exit bill passed by Holyrood in March is constitutional and “properly within devolved legislative powers”.

SNP ministers in Edinburgh brought forward the legislation after branding the UK Government’s European Withdrawal Act a “power grab” – fearing this will mean responsibilities they believe should come to Holyrood after Brexit will instead go to Westminster.

When the Bill was passed, Scottish Government ministers insisted it was within Holyrood’s competence – although the Scottish Parliament’s Presiding Officer Ken Macintosh ruled against them on this.

As a result of the UK Government’s legal challenge, the Supreme Court has been asked to decide if the UK Withdrawal from the European Union (Legal Continuity) (Scotland Bill) is indeed “within the competence of the Scottish Parliament”.

At a hearing in July, a panel of seven justices, including the court’s president Lady Hale and deputy president Lord Reed, were urged to find that the  legislation “cannot stand”.

The issue was referred to the court to seek legal certainty “in the public interest” by the Attorney General and the Advocate General for Scotland, the UK Government’s senior law officers.

Advocate General for Scotland Lord Keen told the justices their case was “the Scottish Bill as a whole cannot stand”.

He submitted the Bill “impermissibly modifies” the UK Act on withdrawal from the EU.

The UK Bill was given Royal Assent on June 26 and became the European Union (Withdrawal) Act 2018.

The law officers said in their written case before the Supreme Court that the Scottish Bill was passed “without knowledge” of the outcome of negotiations between the UK Government and the EU institutions and “pre-empts them”.

They stated: “The effect of what the Scottish Bill does is to make provision for the future relationship with the EU and EU law when that relationship is under negotiation.”

They submitted that this “could serve to undermine the credibility of the UK’s negotiation and implementation strategy in the eyes of the EU”.

As well as hearing the case put forward by the law officers, the justices received submissions in response from Lord Advocate James Wolffe QC.

He argued the justices should rule “in the negative” on the question posed by the law officers relating to whether the Bill  “as a whole” is outside the legislative competence of the Scottish Parliament.

He pointed out that although the reference to the court “arises in a politically contentious context, the issues which arise for the court’s determination are strictly issues of law”.

Mr Wolffe said: “The purpose and effect of the Scottish Bill is to promote legal certainty by making provision for the continuity within the domestic legal system of existing EU-derived law upon and following withdrawal.

“Regardless of any treaty on the future relationship which may be entered into between the UK and the EU, there is a need to provide for legal certainty and continuity when the UK leaves the EU in March 2019, and that is the purpose and effect of the Scottish Bill.”

The issue the Supreme Court has been asked to decide is “whether the UK Withdrawal from the European Union (Legal Continuity) (Scotland Bill) is within the competence of the Scottish Parliament”.