A person standing on asphalt road with gender symbols of male, female, bigender and transgender.

Transgender people in North Carolina can now use restrooms that match how they identify themselves in many of the state-run buildings.

Federal judge Thomas Schroeder approved a legal settlement which grants the rights in exchange for the agreement of transgender plaintiffs to drop pending legal action against the state’s Democratic governor and other defendants, reports NBC News. Schroeder’s signature ends a three-year legal battle between the two sides.

Under the agreement, transgender people can use all public facilities in accordance with their gender identity in any building operated by the state’s executive branch.

Despite this week’s agreement, transgender people in North Carolina and their supporters are left wanting more rights. That’s because there remains a moratorium on new local anti-discrimination ordinances in North Carolina until the end of 2020.

The fight for the rights of transgender people to use public restroom areas that correspond with how they identify themselves has been waged across the United States on the federal, state and local levels. For example, the United States Supreme Court in June declined to take up an appeal of a Pennsylvania school district’s policy allowing transgender students to use the restrooms and locker rooms that correspond with how they identify themselves.