A federal judge in Texas has blocked the Obama administration's rule directing public schools to allow transgender students to use bathrooms and locker rooms matching their gender identity.

Texas was joined by 12 other states and two school districts in filing a lawsuit against the directive. The other states are Alabama, Louisiana, Wisconsin, West Virginia, Arizona, Utah Tennessee, Maine, Oklahoma, Georgia, Mississippi and Kentucky.

The administration issued the guidance in light of the passage of a North Carolina bill that would have restricted the public restroom use of transgender people. House Bill 2 requires them to use public restrooms assigned to their biological sex, regardless of gender identity or transgender status.

Mary Kusler, the director of government relations at the National Education Association, criticized the ruling.

"It’s clear that folks have tried to politicize the guidance and we will be watching the process play out," she said. "We hope as it continues to play out, we put the needs of the students front and center."

Emily Wilkins contributed to this report.Get breaking news alerts and more from Roll Call on your iPhone or your Android.