Humza Yousaf has been urged not to spend more taxpayers’ money on a legal fight with Westminster over Holyrood gender reforms after losing at Scotland's highest court.

The Scottish Tories said the First Minister had already squandered hundreds of thousands of pounds on a “self-serving but doomed case” that had ended in a “humiliating defeat”.

Alba also said Mr Yousaf should quit and “completely scrap” the gender reforms.

However, in a sign of possible friction within the SNP-Green Government, the Scottish Greens urged Mr Yousaf to carry on. 

Green MSP Maggie Chapman said: "I hope the Scottish Government will consider all options for appeal."

The Scottish Government has already spent around £230,000 on the case, most of it on outside legal advice, and now faces extra costs after losing at the Court of Session.

In theory, it could appeal to the Court’s Inner House and then to the UK Supreme Court, pushing the cost to the public purse higher still.

It is understood the UK Government's costs for the case are already in excess of £100,000 and it is minded to recover them.

It followed judge Lady Haldane ruling against the Scottish Government in a landmark case about the UK Government vetoing legislation passed at Holyrood.

MSPs passed the Gender Recognition Reform (Scotland) Bill in December last year by 86 votes to 39 on a cross-party basis.

The Bill aimed to speed up and simplify the process for changing one’s legal sex in Scotland through a gender recognition certificate.

Although the subject matter was devolved, the UK Government blocked the Bill from becoming law, arguing it adversely affected UK-wide equality law.

For the first time since the establishment of devolution, Scottish Secretary Alister Jack used an order under Section 35 of the 1998 Scotland Act to veto the Bill.

Mr Yousaf pledged during the SNP leadership contest in the spring to challenge the order on principle if he became First Minister and launched a judicial review in April.

The Scottish Government argued over two days in September that Mr Jack's decision had been unlawful, irrational and based on an error in law, while the UK Government rejected that, arguing he had been within his rights to make the S35 order in the way he did. 

Lady Haldane today agreed that the decision had been legitimate and dismissed the Scottish Government’s attempt to overturn it.

The Scottish Government has 21 days in which to decide whether to appeal to a panel of judges in the Court of Session's Inner House.

The decision came just two days after the Scottish Government lost another case at the Court against Scotland’s Information Commissioner about the withholding of information related to Nicola Sturgeon potentially misleading Holyrood about Alex Salmond.

Mr Jack said: “Following this latest Court defeat for the Scottish Government, their ministers need to stop wasting taxpayers’ money pursuing needless legal action and focus on the real issues which matter to people in Scotland - such as growing the economy and cutting waiting lists.” 

Scottish Tory deputy leader Meghan Gallacher MSP said: “This is a humiliating defeat for Humza Yousaf and the SNP, who have once again squandered taxpayers’ cash on a self-serving but doomed court case.

“Their reckless Gender Recognition Reform Bill is deeply unpopular with the Scottish public because its self-ID principle compromises the safety of women and girls – as the case of a double-rapist being sent to a female prison demonstrated.

“In addition, the Bill impacted on equalities law south of the border, which is why the UK Government had no option but to issue a Section 35 Order.

“Rather than taking that as a cue to redraft their flawed bill, the SNP dug their heels and turned an issue of women’s safety into another constitutional grievance – a cynical tactic which has backfired today.

“Humza Yousaf must now listen to the court, as well as the court of public opinion, not appeal this ruling and ditch the Bill for good.

"We all want to see the lives of trans people improved but that can’t come at the expense of the hard-won rights of women and girls.”

But Ms Chapman said “This is a devastating day for equality.

"It is a democratic outrage, crushing basic rights and equality for some of Scotland’s most marginalised people. It shows the huge limitations and constraints on devolution and confirms that the UK Government refuses to see our trans siblings for the people they really are.

“It is horrible, it is heartbreaking and it is unjust.

"It makes a mockery of any vote or decision that we as parliamentarians take at Holyrood from now on, if the result is knowing that Westminster will veto anything they don’t like.

“Self-ID is normal and is used in countries around the world. What our Parliament voted for was a small change that would have made a big difference to a vulnerable community. I hope the Scottish Government will consider all options for appeal.

“We stand in solidarity with our trans siblings and call on every fair and decent minded individual who believes in equality and democracy to do the same."

“This is far from over. It is not about trans rights or democracy alone, it is about our very right to be who we are, who we want to be and what kind of country we want to live in. That must now start and end with independence and a fairer and more equal Scotland.”

Alba MSP Ash Regan, who resigned as an SNP minister last year over the GRR reforms, called on Mr Yousaf to accept defeat and cease the legal challenge.

She said: “It was disappointing that we ended up in this situation in the first place but not unpredictable and I had previously warned the Scottish Government that they were attempting to face down Westminster on an issue that they would lose.

“Many high profile incidents have now shown us that the gender recognition reforms proposed are not fit for purpose. 

“Hundreds of thousands of pounds have already been wasted and it would be unimaginable for the Scottish Government to appeal this decision and then potentially proceed to asking the UK Supreme Court to overturn a decision of Scotland’s highest court.

“I resigned from the Government as I simply could not support legislation that is so ill thought out, opposed by women’s groups across Scotland and a fundamental risk to the safety of women and girls. 

“The Scottish Government lost the battle in court and they will further lose the support of the people of Scotland if they keep pursuing this policy. 

“I urge Humza Yousaf to now completely scrap his Government’s gender reforms.” 

Labour MSP and Shadow Scottish Secretary Ian Murray added: “It is disappointing this legalisation ended in the courts but this ruling should be respected.

“It is shameful that after years of debate, trans people feel no more protected and women no more reassured. 

“This is another demonstration of why both governments have to work together rather than spending taxpayers money fighting in courts and pitting communities against each other.”