WASHINGTON — The president of the University of Virginia, facing heavy pressure from conservative critics and the Donald Trump administration over the school’s diversity, equity and inclusion practices, said Friday that he was resigning rather than “fight the federal government.”

The departure of James Ryan, who had led the school since 2018, represents a dramatic escalation in the Trump administration’s effort to reshape higher education. Doing it at a public university marks a new frontier in a campaign that has almost exclusively targeted Ivy League schools. It also widens the rationale behind the government’s aggressive tactics, focusing on DEI rather than alleged tolerance of antisemitism.

Ryan had faced conservative criticism that he failed to heed federal orders to eliminate DEI policies, and his removal was pushed for by the Justice Department as it investigated the school, according to a person who was not authorized to discuss the matter by name and spoke on the condition of anonymity to The Associated Press.

Ryan referenced the Trump administration pressure in a statement to the university community Friday in which he said he had submitted his resignation with a “very heavy heart.”

“To make a long story short, I am inclined to fight for what I believe in, and I believe deeply in this university,” he said. “But I cannot make a unilateral decision to fight the federal government in order to save my job.”

Ryan had already decided that next year would be his last, he said, and remaining in his position until then would be “knowingly and willingly sacrificing this community.”

The New York Times first reported on the resignation and the Justice Department’s insistence on it. Ryan’s removal is another example of the Trump administration using “thuggery instead of rational discourse,” said Ted Mitchell, president of the American Council on Education, which represents university presidents.

“This is a dark day for the University of Virginia, a dark day for higher education, and it promises more of the same,” Mitchell said. “It’s clear the administration is not done and will use every tool that it can make or invent to exert its will over higher education.”

In a joint statement, Virginia’s Democratic senators said it was outrageous that the Trump administration would demand Ryan’s resignation over “ ‘culture war’ traps.” “This is a mistake that hurts Virginia’s future,” Sens. Mark R. Warner and Tim Kaine said.

After campaigning on a promise to end “wokeness” in education, Trump signed a January action ordering the elimination of DEI programs and “radical indoctrination” across the nation’s schools and universities.

The Education Department has opened investigations into dozens of colleges, arguing that diversity initiatives discriminate against White and Asian American students.

The response from schools has been scattered. Some have closed DEI offices, ended diversity scholarships and no longer require diversity statements as part of the hiring process. Some others have rebranded DEI work under other names, while some have held firm on diversity policies.

The University of Virginia became a flashpoint after conservative critics accused it of simply renaming its DEI initiatives.

The school’s governing body voted to shutter the DEI office in March and end diversity policies in admissions, hiring, financial aid and other areas.