The Tokyo District Court ordered the government Thursday to pay damages to a transgender ministry official, ruling that it was illegal for her workplace to impose restrictions on her use of women’s washrooms.

The court ordered the state to pay the Economy, Trade and Industry Ministry official, who was assigned male at birth but now identifies as female, a total of ¥1.32 million.

The ruling is the first in Japan in favor of a plaintiff suffering discrimination in the workplace on the basis of sexual orientation or gender identity, according to lawyers representing the plaintiff.

“The restriction is illegal because it constrains people’s benefits of living their lives in accordance with their self-identified genders,” presiding Judge Kenji Ebara said when handing down the ruling.

Ebara also said he found it “unacceptable” that the ministry’s official in charge of personnel told the plaintiff to “go back to being a man if you’re not having (reassignment) surgery.”

According to the ruling, a doctor diagnosed the plaintiff with gender dysphoria after she started working at the Economy, Trade and Industry Ministry, and she has been living as a woman.

The woman, now in her 50s, began wearing women’s clothes to work in 2010 after consulting her superior in 2009.

But she hasn’t undergone gender reassignment surgery, a prerequisite for a person to change their gender on official documents, due to health issues.

The ministry allowed her to dress as a woman and use the women’s break room, but prohibited her from using the women’s bathroom on her floor and on the floors directly above and below it.

The ministry asked her to instead use toilets for people with disabilities or women’s restrooms two or three floors above or below where she was working because some of her female colleagues expressed a reluctance to use the same toilets, according to the lawsuit.

In 2013, the official asked the National Personnel Authority, which protects the interests of government officials, to improve the situation, but the request was rejected. She filed the lawsuit in November 2015, seeking ¥16.5 million in compensation for psychological pain caused by the bathroom restriction and improvements in work conditions.

As for the ministry’s demand that the plaintiff publicly declare her registered sex as male in order to freely use the bathroom, Ebara determined that it was “abuse of discretion.”

“The ruling will encourage other people having the same concern. Employers should respect human rights,” the woman said at a news conference.

The ministry said it will review the ruling before deciding whether to file an appeal.