President Donald Trump on Wednesday rescinded protections for transgender students that had allowed them to use bathrooms corresponding with their gender identity, overruling his own education secretary and placing his administration firmly in the middle of the culture wars that many Republicans have tried to leave behind.

In a joint letter, the top civil rights officials from the Justice Department and the Education Department rejected the Obama administration’s position that nondiscrimination laws require schools to allow transgender students to use the bathrooms of their choice.

That directive, they said, was improperly and arbitrarily devised, “without due regard for the primary role of the states and local school districts in establishing educational policy.”

The question of how to address the “bathroom debate,” as it has become known, opened a rift inside the Trump administration, pitting Education Secretary Betsy DeVos against Attorney General Jeff Sessions.

Sessions, who had been expected to move quickly to roll back the civil rights expansions put in place under his Democratic predecessors, wanted to act decisively because of two pending court cases that could have upheld the protections and pushed the government into further litigation.

But DeVos initially resisted signing off and told Trump that she was uncomfortable because of the potential harm that rescinding the protections could cause transgender students, according to three Republicans with direct knowledge of the internal discussions.

Sessions, who has opposed expanding gay, lesbian and transgender rights, pushed DeVos to relent. After getting nowhere, he took his objections to the White House because he could not go forward without her consent. Trump sided with his attorney general, the Republicans said, and told DeVos in a meeting in the Oval Office on Tuesday that he wanted her to drop her opposition. And DeVos, faced with the alternative of resigning or defying the president, agreed to go along.

DeVos’ unease was evident in a strongly worded statement she released Wednesday night, in which she said that she considered it a “moral obligation” for every school in America to protect all students from discrimination, bullying and harassment.

She said she had directed the Education Department’s Office for Civil Rights to investigate all claims of such treatment “against those who are most vulnerable in our schools,” but also argued that bathroom access was not a federal matter.