US District Judge Allison Burroughs in Boston announced her intention to issue a preliminary injunction, six days after she first granted Harvard a temporary order blocking the Trump administration's move.
As the court hearing unfolded on Thursday, thousands of Harvard students were receiving their degrees at the school's commencement ceremony on campus about eight kilometres away.
University president Alan Garber, who received a standing ovation, welcomed graduating students "from down the street, across the country and around the world," drawing applause for the last words.
"Around the world – just as it should be," he added.
The Trump administration has launched a multifront attack on the nation's oldest and wealthiest university, freezing billions of dollars in grants and other funding, proposing to end its tax-exempt status and opening an investigation into whether it discriminated against white, Asian, male or straight employees or job applicants.
Revoking Harvard's ability to enroll international students would be damaging, the school says. More than a quarter of the student body is international; nearly 60 percent of the graduate students at the prestigious Harvard Kennedy School hail from other countries.
The attack on Harvard is part of the administration's broader effort to pressure higher education institutions to align with its policy agenda.
On Wednesday, Secretary of State Marco Rubio said the administration would start "aggressively" revoking visas issued to Chinese students attending US schools, including those with ties to the Chinese Communist Party and those studying in critical fields, which he did not specify.
More than 275,000 Chinese students are enrolled in hundreds of US colleges, providing a major source of revenue for the schools and a crucial pipeline of talent for US technology companies. The decision prompted despair and frustration among students who have offers to attend next year.
Prior to Rubio's announcement, the offensive against U.S. colleges had largely been confined to Ivy League schools such as Harvard, Columbia and the University of Pennsylvania, which it has accused of left-wing bias and antisemitism.
Lynn Pasquerella, president of the advocacy group American Association of Colleges and Universities, said the Trump administration's targeting of international students would have negative consequences for schools and the United States.
"Chinese students, in particular, now that they're being faced with hyper-scrutiny, are looking elsewhere," she said.
"That is a huge loss for us. It's a brain drain."
The court hearing before Burroughs took place shortly after the administration softened its stance in an apparent effort to refute Harvard's legal arguments in advance.
Late on Wednesday night, the Department of Homeland Security sent a notice to Harvard saying it would now give the university 30 days to submit evidence contesting the administration's plan to revoke Harvard's right to enroll non-US students.
The notice signaled a change in course for DHS, which had said last week that the revocation was effective immediately. In its lawsuit challenging the move, Harvard argued that DHS had violated federal administrative procedure.
During the court hearing, Department of Justice attorney Tiberius Davis argued there was now no need for a court order blocking the administration's actions, since Harvard could challenge them via an administrative process.
But Burroughs, an appointee of Democratic former president Barack Obama, said she believed a broad preliminary injunction protecting Harvard and students was necessary while that process played out.
She expressed skepticism that Harvard's fate would be any different at its conclusion, saying, "Aren't we still going to end up back here at the same place?"
She also questioned whether the administration had fully complied with her temporary restraining order, pointing to a declaration Harvard submitted on Wednesday that said visas for incoming students had been recently revoked.
Burroughs said the temporary order would remain in effect while lawyers for both sides negotiate over the terms of the injunction. (Reuters)