The United States 4th Circuit Court of Appeals has overturned a decision that barred a transgender teenager from using the boy’s bathroom at his high school in rural Virginia.

The 2-1 ruling was handed down on Tuesday afternoon.

This ruling could impact the legal fight over North Carolina’s controversial House Bill 2 legislation that was signed into law last month.

North Carolina’s law prevents transgender individuals from using the bathroom that matches their gender identity in public venues, including public schools across the state.

Governor Pat McCrory and the GOP leadership in the North Carolina General Assembly have called House Bill 2 “common sense” legislation that protects the privacy of North Carolinians. Advocates have maintained it is the worst anti-LGBT legislation in the nation because it also rolls back local protections that had been put in place to go beyond the state nondiscrimination ordinance.

The Tuesday ruling was based on violations of Title IX protections that state that no person “shall, on the basis of sex, be excluded from participation in, be denied the benefits of, or be subjected to discrimination under any education program or activity receiving Federal financial assistance.”

The American Civil Liberties Union of North Carolina, along with the national ACLU and Lambda Legal, have filed a lawsuit challenging House Bill 2 saying it puts the state at risk of losing more than $4 billion in Title IX funding.

The ACLU of North Carolina issued the following statement after the ruling:

“Today’s ruling makes plain that North Carolina’s House Bill 2 violates Title IX by discriminating against transgender students and forcing them to use the wrong restroom at school. This mean-spirited law not only encourages discrimination and endangers transgender students – it puts at risk billions of dollars in federal funds that North Carolina receives for secondary and post-secondary schools. House Bill 2 exposes North Carolinians to discrimination and harm, is wreaking havoc on the state’s economy and reputation, and now more than ever, places the state’s federal education funding in jeopardy. We again call on Governor McCrory and the General Assembly to repeal House Bill 2 and replace it with full nondiscrimination protections for LGBT people.”

McCrory issued a statement on Tuesday evening saying that this amounts to government overreach.

“I strongly disagree with both President Obama and Attorney General Roy Cooper’s objective to force our high schools to allow boys in girls’ rest rooms, locker rooms or shower facilities. I think that’s bad precedent and I don’t think it’s the traditional way we do things.

The way I think we should have done it is to allow the high schools to make the appropriate arrangements for those students who have unique circumstances. But this is the federal government, very similar to the Charlotte government, forcing brand new standards, that we’ve never seen before.

So, we have to evaluate the impact of this court ruling on existing legislation, on existing policy that we have throughout North Carolina, and I will do just that.”

This story will be updated with more information as it becomes available.