Asheville, North Carolina, USA - April 2, 2016: An activist holds a sign at a HB2 protest rally of a law that takes away the rights of the LGBTQ community. Photo: Shutterstock

Asheville, North Carolina, USA - April 2, 2016: An activist holds a sign at a HB2 protest rally of a law that takes away the rights of the LGBTQ community. Photo: Shutterstock

A federal lawsuit in North Carolina has ended in a settlement allowing transgender people to use the appropriate public restrooms in state-owned buildings.

US District Judge Thomas Schroeder signed the consent decree, ending the litigation that started in 2016. Transgender people in North Carolina can now use the appropriate facilities under the control of the governor, which include state offices, rest stops, and state parks.

“After so many years of managing the anxiety of HB2 and fighting so hard, I am relieved that we finally have a court order to protect transgender people from being punished under these laws,” said lead plaintiff Joaquin Carcaño.

In 2016, North Carolina passed the infamous House Bill 2 (HB2), which, among other things, forced transgender people to use the bathroom associated with the gender on their birth certificates.

Related: The extremist behind North Carolina’s anti-trans bathroom law is running for the House

HB2 led to national outcry and was replaced in 2017 with HB142, which LGBTQ activists called a “fake repeal.” HB142, though, was effective in rehabilitating the state’s reputation.

HB142 repealed the birth certificate requirement found in HB2, but it left regulation of public restrooms to the state legislature and didn’t specify what the rules would be going forward.

Lambda Legal filed a lawsuit in 2016 on behalf of several transgender clients, and in 2017 they filed an amended complaint to clarify what HB142 means in terms of bathroom access.

According to court documents, current Governor Roy Cooper (D) agreed to end the litigation because it was an “unnecessary expenditure of State resources.”

The settlement signed by the judge states, “Nothing in the language of Section 2 [of HB142] can be construed to prevent transgender individuals from using the restrooms that align with their gender identity.”

“This is a tremendous victory but not a complete one,” said Carcaño. “While I am glad that Governor Cooper agreed to this settlement, it remains devastating to know that local protections for LGBTQ people are still banned under state law while so many members of our community continue to face violence, harassment and discrimination simply because of who we are.”

The settlement does not apply to schools, one of the most contentious parts of the bathroom bill, because they are not under the control of the governor.

“Thank God that public schools are not under the governor’s control, or every bathroom and locker room in public schools would be open to members of the opposite sex,” said Tam Fitzgerald the North Carolina Value Coalition.

North Carolina House Speaker Tim Moore (R) said that lawmakers are “assessing their options.”

“We are thrilled to obtain some clarity and relief for transgender North Carolinians who have been suffering under HB2 and HB142 for years,” said Irena Como, acting legal director of the ACLU of North Carolina.