A federal judge Friday halted the Trump administration’s attempts to block international students from attending Harvard University, the nation’s oldest university and one of its most prestigious.

Harvard had sued the Trump administration earlier in the day and less than 24 hours after the Department of Homeland Security moved to bar international students. Later Friday morning, at the university’s request, the Boston judge, Allison D. Burroughs, issued a temporary restraining order against the federal edict, agreeing that Harvard had shown that its implementation would cause “immediate and irreparable injury” to the university.

The administration’s action, and Harvard’s response, signified a dramatic escalation of the battle between the administration and Harvard. And the university’s forceful and almost immediate response served as evidence that stopping the flow of international students to Harvard, which draws some of the world’s top scholars, would destabilize the school.In a letter to the Harvard community delivered Friday morning, Dr. Alan M. Garber, Harvard’s president, wrote, “We condemn this unlawful and unwarranted action,” adding that it “imperils the futures of thousands of students and scholars across Harvard and serves as a warning to countless others at colleges and universities throughout the country who have come to America to pursue their education and fulfill their dreams.”

The lawsuit, which accused the Trump administration of a “campaign of retribution” against the university, followed an announcement Thursday that Harvard’s Student and Exchange Visitor Program certification had been revoked, halting the university’s ability to enroll international students.

The lawsuit was the second time in a matter of weeks the university had sued the federal government.

In the new lawsuit, the university accused the Trump administration of exerting “clear retaliation for Harvard exercising its First Amendment rights to control Harvard’s governance, curriculum and the ‘ideology’ of its faculty and students.”

“With the stroke of a pen, the government has sought to erase a quarter of Harvard’s student body, international students who contribute significantly to the university and its mission,” the lawsuit said. “Without its international students, Harvard is not Harvard.”

The administration said Harvard had not complied with a list of demands sent on April 16 that contained records of protest activity dating back five years, including videotapes of misconduct and records of disciplinary actions involving international students.

Harvard’s lawsuit also said the university had been working to comply with the April 16 request, along with a letter attacking the university for failure to condemn antisemitism.

Despite the “unprecedented nature and scope” of the demands, calling for information on each student visa holder, about 7,000 students across Harvard’s 13 schools, within 10 business days, Harvard had submitted the required information on April 30, the lawsuit said, and also complied with a follow-up request.

“Yet on May 22, DHS deemed Harvard’s response ‘insufficient,’ without explaining why or citing any regulation with which Harvard failed to comply,” the lawsuit said. It references President Donald Trump’s posts on Truth Social, his social media site, as evidence of his vendetta against Harvard.

White House response

A White House spokesperson, Abigail Jackson, responded to the lawsuit with a statement.

“If only Harvard cared this much about ending the scourge of anti-American, antisemitic, pro-terrorist agitators on their campus they wouldn’t be in this situation to begin with. Harvard should spend their time and resources on creating a safe campus environment instead of filing frivolous lawsuits,” the statement said.

Tricia McLaughlin, assistant homeland security secretary, issued a statement saying the lawsuit “seeks to kneecap the president’s constitutionally vested powers,” adding that it is a privilege, not a right, for universities to enroll foreign students.

“The Trump administration is committed to restoring common sense to our student visa system; no lawsuit, this or any other, is going to change that. We have the law, the facts, and common sense on our side,” the statement said.

The Trump administration has explained its attacks on Harvard and other top private universities as an effort to combat antisemitism and confront liberal biases on campus. During his campaign, Trump invoked the term “Marxist maniacs” to refer to the Ivy League.

After he was inaugurated, Trump’s administration has sought to use nearly every lever the federal government has at its disposal to force schools, Harvard especially, to bend to its will. There are now at least eight investigations into Harvard spanning at least six federal agencies.

The numbers

Harvard enrolls about 6,800 international students, or about 27% of its student body, and the administration edict could ultimately affect both existing students, who would need to find other schools to attend, and newly admitted Harvard students headed for the United States in the fall.

The administration’s announcement Thursday potentially upends students’ lives, and would also be a major financial blow to Harvard. With many of Harvard’s international students enrolled in high-cost graduate programs, the tuition generated by foreign students likely generates several hundred million dollars a year for the university.

Noting the potential disruption of the administration’s action on the lives of students, lawyers for Harvard urged the court to block the order immediately, pending a hearing.

Without such an order, the request said, “thousands of international students who were scheduled to arrive on campus for the upcoming summer and fall terms will no longer be able to enter the country.”

In issuing the temporary order, Burroughs set a hearing for May 29.

In an interview Thursday, a Harvard student from Ukraine, who asked not to be identified, said she feared losing her visa not only because it will disrupt her education but because returning home, amid the war with Russia, is not an option. She is considering going to live with relatives elsewhere in Europe.