WASHINGTON — President 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. Mr. 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.