Humza Yousaf's government has so far spent almost £230,000 on its legal fight with Westminster over Holyrood’s gender reform legislation.

Scottish ministers confirmed they had spent £221,347 hiring “external counsel” and £6,519 on court fees, a total of £227,866 to date.

The spending on outside lawyers was in spite of the Scottish Government's top law officer, the Lord Advocate Dorothy Bain KC, making the administration's arguments in court.

The UK Government will have incurred its own costs.

READ MORE: Scottish Secretary accused of 'closing his eyes' in gender debate

Mr Yousaf promised during the SNP leadership contest in March that he would challenge the UK Government’s veto of the Gender Recognition Reform Bill (GRR).

The legislation was passed with cross-party support by 86 votes to 39 in December.

It was intended to speed up and simplify the process for a trans person to change their gender in the eyes of the law by obtaining a gender recognition certificate (GRC).

Under the current UK-wide system, this takes at least two years, requires a medical diagnosis of gender dysphoria and is available only to those aged 18 and above.

The Holyrood Bill would have changed the time period to three to six months, replaced a medical diagnosis with self-declaration (Self-ID) and reduced the age threshold to 16.

However before the Bill became law, Scottish Secretary Alister Jack vetoed it by making an unprecedented order under Section 35 of the Scotland Act 1998.

He argued that although the issue was within Holyrood’s powers, the Bill nevertheless cut across UK-wide equality law and could pose a risk to single-sex spaces.

The Scottish Government went to the Court of Session in September in a bid to overturn the Section 35 order, arguing it was unlawful and irrational.

The UK Government defended it, saying Mr Jack had been legally entitled to act as he did.

Judge Lady Haldane said she would take “some time” to give her decision, calling the case “unique, very interesting and challenging”.

The losing side is expected to appeal the case all the way to the UK Supreme Court.

The two governments could have been forced to return to court to revise their arguments if a related case was successfully appealed, but that appeal was today dismissed.

UNSPUN: Is the independence debate slowly throttling Scotland?

Scottish Tory deputy leader Meghan Gallacher said: “The SNP pushed through their flawed self-ID bill in the face of huge public opposition and warnings that it compromised women’s safety and breached UK equality law.

“When its legality was rightly challenged, they adopted the same stubborn approach. Now the Scottish taxpayer has been landed with a bill of almost £230,000 for their failed bid to ram through these reckless and unpopular measures. And that’s only the cost to date.

“The SNP should immediately drop their attempts to pursue this any further, take steps to address real concerns about the bill, and make sure the rights of women and girls are protected.”

Alba MSP Ash Regan, who defected from the SNP on Saturday, urged her former colleagues to drop the GRR Bill appeal.

She said: “If the Scottish Government succeed in their challenge to the UK Government’s Section 35 order and bring the legislation into force it will make it easier for predatory men to invade the privacy, and threaten the safety, of women and girls. 

“Therefore I call on Humza Yousaf to scrap his legal battle over the Gender Recognition Reform Act and to confirm that he will cancel plans to proceed with the legislation.”

Mr Yousaf said in August that the GRR challenge was "not actually about the legislation itself" but about the "principle" involved.

The First Minister said: "If the parliament passes by a majority a piece of legislation, why can another government come in and veto that legislation? Even if it was legislation I completely disagreed with, I would absolutely fight for the principle.

“You've got a UK Government, a Secretary of State for Scotland and a Scotland Office who are just looking at any wedge issue they possibly can and deciding, We'll use our powers to overrule.”