A court ordered the government on Thursday to pay damages to a transgender official, ruling that it was illegal for her workplace to impose restrictions on her use of women's toilets.

The Tokyo District Court ordered the state to pay the official, who was born male but has led a life as a female, a total of 1.32 million yen ($12,000).

It is the first court ruling in Japan in favor of a plaintiff suffering discrimination in a workplace on the basis of sexual orientation or gender identity and seeking improved treatment, according to the lawyers of the plaintiff.

Related coverage:

Most people in Japan know LGBT but understanding limited

Yokohama recognizes partnerships for LGBT couples

Moving toward a safe space for LGBT at Japan's universities

Presiding Judge Kenji Ebara said when handing down the ruling that an individual's right to lead a social life based on his or her gender identity should be protected under the state redress law, adding that it was illegal to restrict the use of women's toilets on the floor where her department is located, as well as those one floor above and below.

The ruling also declared that it was illegal for her superior to tell her to "become a man again."

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

The official began wearing women's clothes at work after consulting her superior in 2009.

But the official had been told to use toilet booths for disabled people or women's restrooms two or more floors away from her department because some of her female colleagues have expressed reluctance to use the same toilet, 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.

The ministry does not restrict toilet use for those who have changed their gender on the census register, but the official has never undergone sex change surgery, a prerequisite for changing gender in the official record, due to health issues.

"The ruling will encourage other people having the same concern. Employers should respect human rights," the official said in a press conference.

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