WASHINGTON -- A North Carolina law that bans transgender individuals from using the bathroom that corresponds with their gender identity violates federal civil rights laws by discriminating against students and employees on the basis of sex, the Justice Department told Gov. Pat McCrory (R) on Wednesday.

Vanita Gupta, the head of the Justice Department's Civil Rights Division, wrote a letter that gives McCrory until Monday to confirm that “the State will not comply with or implement HB2,” according to The Charlotte Observer.

Federal officials have previously said that states that fail to give transgender students full access are engaged in discriminatory activity. Last month, the federal appeals court in the 4th Circuit ruled in favor of a transgender high school student who is suing his school board because he was banned from the boys' bathroom.

CHRIS KEANE / Reuters The DOJ has warned North Carolina Gov. Pat McCrory that the state's anti-LGBT legislation violates federal laws.

The state of North Carolina and McCrory have come under increased pressure from outside organizations as a result of the law, which was passed to prevent the city of Charlotte from establishing an anti-discrimination ordinance. The federal government says that the law violates both the rights of employees under the Civil Rights Act and the rights of students under Title IX, meaning that the state could lose out on millions of dollars in federal school funding.

The law, Gupta wrote, "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."