President Trump on Wednesday went directly against the protections for transgender students that had allowed them to use bathrooms corresponding with their gender identity, placing his administration firmly in the middle of the culture wars that Republicans have tried to move away from.

The top civil rights officials from the Justice Departments and the Education Department, in a joint letter, rejected the Obama administration’s position to allow transgender students to use their bathroom of choice.

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

Education Secretary Betsy DeVos originally resisted signing off because she wasn’t comfortable with the potential harm, but Attorney General Jeff Sessions decided to bring his objections to the White House. President Trump sided with Sessions, the Republicans said, and told Ms. DeVos in a meeting in the Oval Office on Tuesday that he wanted her to drop her opposition.

Ms. DeVos was faced with the alternative of resigning or defying the president and, in the end, agreed to go along.

Even though Wednesday’s order rolls back transgender protections heavily, it includes language stating that schools must protect transgender students from bullying. Ms. DeVos personally asked for this provision.

“All schools must ensure that students, including L.G.B.T. students, are able to learn and thrive in a safe environment,” the letter said