(Reuters) - A Pennsylvania school district will let students use bathrooms matching their gender identity under a settlement announced on Tuesday that ended a federal lawsuit brought by a group of transgender students.

FILE PHOTO: A Gender Neutral Restroom sign is seen placed outside a restroom for the 15th Annual Philadelphia Trans-Health Conference in Philadelphia, Pennsylvania, U.S., June 9, 2016. REUTERS/Shannon Stapleton/File Photo

The lawsuit, which targeted the Pine-Richland School District in suburban Pittsburgh, was filed last year on behalf of three transgender students who claimed that a district policy mandating that students use bathrooms matching their biological gender or use unisex restrooms was discriminatory.

The settlement comes amid a broader national debate over gender identity and bathroom use, which followed North Carolina’s passage last year of a law requiring people to use public restrooms that corresponded with their birth gender. The measure was partially repealed in March after the state lost hundreds of millions of dollars from economic boycotts.

In February, a federal judge issued a preliminary injunction against the Pennsylvania district’s policy.

Under the settlement, filed in U.S. district court in Pittsburgh, “any student across the district may access restrooms based upon his or her consistently and uniformly asserted gender identity” or single-user bathrooms, the school district said in a statement.

The settlement also requires inclusion of gender identity in the district’s nondiscrimination practices and an undisclosed monetary payment, according to a statement from the Lambda Legal Defense and Education Fund, which brought the suit on behalf of the students.

“This is a victory for transgender students everywhere and sends a clear warning to school districts with anti-transgender bathroom policies,” Lambda Legal lawyer Omar Gonzalez-Pagan said in the statement.

Two of the students who sued were born anatomically male and now identify as female, and the third was born anatomically female and identifies as male. The three have since graduated from Pine-Richland High School.

A measure similar to North Carolina’s passed the Texas Senate last week and is before the state’s House of Representatives. Proponents of the bathroom bills say they aim to protect individual privacy and enhance public safety.

Republican President Donald Trump stepped into the debate over gender issues last week when he said he would ban transgendered people from the U.S. military.

The move appealed to some in his conservative political base but triggered uncertainty about the fate of thousands of transgender service members.