TOKYO (AP) — Japan’s Supreme Court on Wednesday ruled that a law requiring transgender people to have their reproductive organs removed in order to officially change their gender is unconstitutional.

The decision by the top court’s 15-judge Grand Bench was its first on the constitutionality of Japan’s 2003 law requiring the removal of reproductive organs for a state-recognized gender change, a practice long criticized by international rights and medical groups.

The decision now requires the government to revise the law, which paves the way for transgender people to have their gender changed in official documents without surgery.

The case was filed by a plaintiff whose request for a gender change in her family registry — to female from her biologically assigned male — was turned down by lower courts.