SCOTTISH taxpayers have been left with a £130,000 legal bill after the UK Government mounted an unprecedented challenge to Holyrood legislation.

The Scottish Government spent £131,317 on external legal advice on defending its emergency Brexit Bill at the UK Supreme Court last year.

Court fees and administration costs brought the total price-tag to £131,900, the Scottish Government has now revealed.

MSPs passed their Continuity Bill in March 2018 as an alternative to the key Brexit legislation at Westminster, the EU Withdrawal Bill, to which they refused to give consent.

READ MORE: Court battle looms as Holyrood passes alternative Brexit Bill

The SNP, Labour, Greens and most LibDem MSPs said the UK legislation was a ‘power grab’ on devolved issues due to be repatriated from the EU.

The Continuity Bill was highly controversial at the time.

Presiding officer Ken Macintosh advised MSPs it was outside Holyrood’s remit, but they passed it regardless following assurances from the Scottish Government’s highest law officer, the Lord Advocate James Wolffe QC, that it was legally competent.

The UK Government then referred the Bill to the UK Supreme Court to have it struck down, stopping it from becoming law while Westminster passed its EU Withdrawal Bill instead.

The UK legislation then received Royal Assent to become the EU Withdrawal Act, overtaking and invalidating most of the earlier Holyrood legislation.

In December, the Supreme Court unanimously ruled that almost all of the Holyrood Bill had been lawful when it was passed.

However, more than 20 of its key sections could not become because of the subsequent EU Withdrawal Act, which had changed the “legal landscape”.

READ MORE: Supreme Court partially upholds Holyood 'power grab' law

The Scottish Government accepted the judgment and, after cross-party talks on salvaging it, formally abandoned the Continuity Bill in April.

In a new written parliamentary answer, Brexit Secretary Michael Russell has now revealed the Scottish Government’s external legal costs as a result of the Supreme Court referral.

In it, he said: “The case raised significant issues of general importance for the legislative competence of the Scottish Parliament, including the scope and effect of a number of reserved matters and the extent to which an Act of the Scottish Parliament is susceptible to challenges on common law grounds.

“The external legal fees include fees of counsel and solicitors. The Lord Advocate's expenses are not included, as Ministerial costs are routinely published by the Government.

“The cost of internal legal advice is not included as that is provided by Government lawyers who are civil servants as part of their normal duties supporting Scottish Ministers.”

READ MORE: Constitutional Relations Secretary vows to protect Scots law after Brexit

A Scottish Government spokesperson added: “The costs incurred by the Scottish Government in the Supreme Court were essential to protect the Scottish Parliament.

“The decision to refer the Continuity Bill to the Supreme Court was taken by UK Law Officers. If they had not done so there would have been no cost to the Scottish Government

“The Supreme Court judgment  confirmed that the Scottish Parliament did have the power, at the time the Bill was passed, to decide what should be done to prepare devolved law for Brexit – contrary to the arguments of UK law officers.

“The Scottish Government will always vigorously protect the Scottish Parliament and devolution in Scotland as a whole.”

SNP MSP Tom Arthur said: "The Tories never wanted devolution in the first place and have used Brexit to launch a power grab on the Scottish Parliament.

"The expense of the Supreme Court case  lies squarely at the door of the UK Tory government who attempted to roll back devolution even further.

"The action taken by the Scottish Government to protect our Parliament was vindicated by the Supreme Court’s ruling but the danger to devolution is very clear as Tory leadership hopefuls like Michael Gove are seeking new ways to undermine Holyrood."

A UK Government spokesperson said: "For the first time ever, the Scottish Government decided to press ahead with legislation which had been ruled by the Presiding Officer to be beyond the legal competence of the Scottish Parliament. Given these unprecedented circumstances, the UK Government had little option but to seek absolute legal clarity.

"The Supreme Court found the Bill did indeed go beyond the powers of the Scottish Parliament. In seeking this clarification, we followed the legal process as set out in the Scotland Act 1998.”

Last month it emerged the Scottish Government had spent £174,000 on external legal advice to deny their own ‘fracking ban’ existed when challenged in a judicial review.