The U.S. Department of Justice has told the University of North Carolina system that it must stop complying with the state’s controversial law requiring transgender people to use bathrooms corresponding to their birth certificates, arguing that the state law violates federal civil rights protections.

The directive to UNC President Margaret Spellings was delivered in a letter on the same day that Justice officials told North Carolina Gov. Pat McCrory (R) that he must disavow the law or risk losing hundreds of millions of dollars in federal funding. Justice gave both Spellings and McCrory until May 9 to reject the state law or risk legal action.

Spellings, a former U.S. education secretary under George W. Bush, said that she would respond by that deadline. “We take this determination seriously and will be conferring with the governor’s office, legislative leaders and counsel about next steps,” she said in a statement.

In early April, Spellings sent a memorandum to the chancellors of each of the state’s universities, outlining what they needed to do to comply with the state’s bathroom law, HB 2. The guidance said that universities should require “every multiple-occupancy bathroom and changing facility to be designated for and used only by persons based on their biological sex.”

The memo immediately sparked a backlash from student activists and LGBT advocates, who criticized Spellings for supporting and following a law that many believed was discriminatory. In response, Spellings issued lengthy comments saying that her guidance had been “misinterpreted as an endorsement of the law. Nothing could be further from the truth,” she said. “We will not tolerate any sort of harassing or discriminatory behavior on the basis of gender identity or sexual orientation.”

In her letter to Spellings on Wednesday, Vanita Gupta, Justice’s principal deputy assistant attorney general, wrote that the promise not to tolerate discrimination “cannot be reconciled with UNC’s limitations on bathroom access for transgender individuals on UNC campuses.”

The Obama administration argues that forcing transgender students to use bathrooms that correspond to their biological sex, instead of their gender identity, violates Title IX, Title VII of the Civil Rights Act of 1964, and the Violence Against Women Act. It’s an interpretation that has been cheered by LGBT advocates but has also sparked a backlash from some parents and state lawmakers who call it an assault on traditional values and student privacy.

Gupta said that in order to avoid legal action, Spellings must by May 9 retract her April memo to universities and advise “the public, including UNC students, employees and third parties, that, in accordance with federal law, individuals are permitted to access UNC restrooms and other facilities consistent with their gender identity.”