LONDON -- The British government said Monday it will block a new law that makes it easier for people in Scotland to legally change their gender, sparking conflict with transgender rights advocates and the nationalist Scottish administration in Edinburgh.

Secretary of State for Scotland Alister Jack said he would prevent the bill from getting royal assent 鈥 the final formality that makes it law 鈥 because of concern it conflicts with 鈥淕reat Britain-wide equalities legislation.鈥 That legislation, among other things, guarantees women and girls access to single-sex spaces such as changing rooms and shelters.

The Scottish government is likely to challenge the decision at the U.K. Supreme Court.

Scottish First Minister Nicola Sturgeon called the decision by Prime Minister Rishi Sunak鈥檚 Conservative government 鈥渁 full-frontal attack鈥 on the Scottish parliament, which approved the bill last month.

鈥淭he Scottish Government will defend the legislation and stand up for Scotland鈥檚 Parliament,鈥 she said on Twitter. 鈥淚f this Westminster veto succeeds, it will be first of many.鈥

The Scottish bill allows people aged 16 or older in Scotland to change the gender designation on their identity documents by self-declaration, removing the need for a medical diagnosis of gender dysphoria.

It also cuts the time trans people must live in a different expressed gender before the change is legally recognized, from two years to three months for adults and to six months for people aged 16 and 17.

The legislation sets Scotland apart from the rest of the United Kingdom, where a medical diagnosis is needed before individuals can transition for legal purposes.

The Scottish National Party-led government in Edinburgh says the legal change will improve the lives of transgender people by allowing them to get official documents that correspond with their gender identities.

Opponents claim it risks allowing predatory men to gain access to spaces intended for women, such as shelters for domestic abuse survivors. Others argue that the minimum age for transitioning should remain at 18.

Scotland is part of the United Kingdom but, like Wales and Northern Ireland, has its own semi-autonomous government with broad powers over areas including health care.

This is the first time a U.K. government has blocked a Scottish law since the Scottish government and parliament were established a quarter century ago. The move will provide fodder for nationalists who want Scotland to break away from the U.K. and become an independent country.

Jack, the U.K. minister responsible for Scotland, said he had 鈥渘ot taken this decision lightly.鈥

鈥淭ransgender people who are going through the process to change their legal sex deserve our respect, support and understanding,鈥 he said in a letter to Sturgeon. 鈥淢y decision today is about the legislation鈥檚 consequences for the operation of GB-wide equalities protections.鈥

Shami Chakrabarti, a Labour Party member of the House of Lords and former director of the rights group Liberty, said Sunak鈥檚 government might be trying to stir up 鈥渃ulture wars鈥 by stepping in, but legally 鈥渢hey may have a point.鈥

鈥淚t is arguable, at least, that what鈥檚 happened in Scotland has a potential impact on the legislation as it operates U.K.-wide,鈥 she told the BBC.

Several countries around the world have legalized gender self-recognition, including Argentina, Canada, New Zealand, Denmark and Iceland. Last month Spain鈥檚 parliament approved a bill similar to Scotland鈥檚.