Scottish ministers have about three weeks to decide if they are going to appeal the bill, ITV News Political Reporter Jasmine Cameron-Chileshe says
A judge has ruled the UK was acting legally when it blocked reforms in Scotland to make it easier for transgender people to change sex.
Westminster used a never-before-used legislation last year to prevent Scotland's Gender Recognition Reform Bill from becoming law.
It would have simplified the process for transgender people to get a Gender Recognition Certificate (GRC), thereby officially changing their legally-recognised sex.
The Bill would have also removed barriers such as seeking a doctor's diagnosis of gender dysphoria, and lowered the application age to 16. In the UK, the minimum age is 18.
Campaigners against the reforms warned the legislation could risk the safety of women and girls while supporters argued it would make the process easier.
The legislation received cross-party support in Holyrood, passing by 86 votes to 39 last year.
But Scottish Secretary Alister Jack blocked these reforms using Section 35 of the Scotland Act - which gives cabinet ministers the power to stop bills from becoming laws in certain situations.
Scotland's highest civil court ruled on Friday that the UK government was within its right to do so.
During a two-day hearing in Edinburgh in September, Lord Advocate Dorothy Bain, representing Scottish ministers, argued that Mr Jack used the landmark power because of a “policy disagreement”.
She also argued the order was “inconsistent with the constitutional principles” of the UK to recognise Scotland as a "broad and largely unfettered power".
Acting on behalf of UK ministers, David Johnston KC argued the Scottish Secretary had “justified” grounds for using the order to block the reforms.
He said the reforms would've superseded or amended the 2004 Gender Recognition Act by changing the meaning of a GRC by removing the gender dysphoria diagnosis and lowering the application age to 16.
Mr Johnson added it was "simply irrelevant" where the power was used because of a policy disagreement.
He said Westminster “completely accepts that the Scottish Parliament is entitled to make its own legislation and that this is within its devolved power”.
Want a quick and expert briefing on the biggest news stories? Listen to our latest podcasts to find out What You Need To Know