The Justice Department on Wednesday said a North Carolina law barring people from using the public facilities of the opposite sex is in conflict with federal nondiscrimination law.

In a letter to Republican Gov. Pat McCrory, first reported by the Charlotte Observer, principal deputy assistant Attorney General Vanita Gupta said the law violates both Title VII of the Civil Rights Act and Title IX of the Education Amendments of 1972.

The department said state officials have until Monday to address the issue “by confirming that the State will not comply with or implement” the law. North Carolina could lose millions in federal education funding by not complying with the order.

“The Department of Justice has determined that, as a result of compliance with and implementation of NC House Bill2, both you and the state of NC are in violation of Title VII of the Civil Rights Act of 1964,” the letter said.

“Title VII prohibits an employer from discriminating against an individual on the basis of sex and from otherwise resisting the full enjoyment of Title VII rights…

“Federal courts and administrative agencies have applied Title VII to discrimination against transgender individuals based on sex, including gender identity….

“Access to sex-segregated restrooms and other workplace facilities consistent with gender identity is a term, condition or privilege of employment. Denying such access to transgender individuals, whose gender identity is different from the gender assigned at birth, while affording it to similarly situated non-transgender employees, violates Title VII …

“HB 2…is facially discriminatory against transgender employees on the basis of sex because it treats transgender employees, whose gender identity does not match their biological sex, as defined by HB2, differently from similarly situated non transgender employees…

“Based upon the above, we have concluded that in violation of Title VII, the state is engaged in a pattern or practice of resistance to the full enjoyment of Title VII rights by employees of public agencies…

“Please advise the department, therefore, no later than the close of business on May 9, 2016, whether you will remedy these violations of Title VII including by confirming that the state will not comply with or implement HB2….

“We further inform you that that today the department sent letters addressed to the NC Department of Public Safety and the University of NC similarly notifying them of our conclusion that they have engaged in violations of Title VII as well as violations of Title IX.”

North Carolina public schools have received $861 million in federal funding this school year.