The Trump Justice Department is dropping the federal lawsuit against North Carolina's "bathroom law" after the state agreed to replace the controversial measure.

Sandra Hairston, the acting U.S. Attorney for the Middle District of North Carolina; and T.E. Wheeler, the acting assistant attorney general and head of the Justice Department's civil rights division, announced the decision in a filing seeking to dismiss the government's lawsuit.

ADVERTISEMENT

The 2016 law, also known has House Bill 2, blocked a Charlotte city ordinance that, among other things, protected the ability of transgender people to use the bathroom that corresponded with their gender identity. The state law required people to use the bathroom corresponding to the sex listed on their birth certificate. It was passed by the state's GOP-controlled House and signed by the Republican governor.

Its passage prompted criticism from businesses and activists, and created some high-profile problems for the state. The NBA moved this year's All-Star Game out of the state in protest, and the NCAA and other college sports conferences pulled events from the state as well.

Former Attorney General Loretta Lynch filed suit against the law during the Obama administration, arguing it was discriminatory.

After the 2016 elections brought in Democratic Gov. Roy Cooper, though, state legislators struck a compromise to replace portions of the controversial law.

That spurred some organizations, including the NCAA, to resume business with the state. But some Democrats and LGBT rights groups have assailed the compromise as a repeal in name only, noting that it is not a full repeal and blocks governments from enacting similar ordinances until 2020.

Those advocacy groups are still mounting legal challenges, but the federal government's filing Friday drops its formal opposition to the state's policies.