SAN FRANCISCO — In a courtroom packed with doctors, nurses and patients from Doctors Medical Center, a U.S. District Court judge tentatively denied requests for an injunction Wednesday to keep the beleaguered San Pablo hospital open and restore its staffing and services to levels that existed before the emergency room was closed to ambulance traffic earlier this month.

District Judge William H. Orrick did not make a final ruling Wednesday, saying that he would need some time to carefully reconsider the plaintiffs’ argument that he should intervene because the hospital’s diminished services mean that Contra Costa County is no longer meeting state and federal standards.

“Everybody here acknowledges the impact of DMC’s closure,” said Orrick, before adding that his two concerns were whether there was a legal argument he could “hang his hat on” to take the “quite extraordinary” step of a mandatory injunction, and whether doing so would benefit anyone.

Nurses, doctors, patients and community members filed the suit earlier this month seeking to stop the possible closure or downsizing of West Contra Costa’s only public hospital, which is deep in the red and losing staff as uncertainty about its future continues.

“The remedy that you’re asking for I don’t think does good for the people you want to help,” Orrick said. “They’re going to be closing very soon, and if I ordered them to spend more money, they’d close sooner.”

A spokesman for the hospital said the unit consolidation was initially scheduled for Sept. 5 but was done Tuesday night after administrators determined there weren’t enough patients to justify continuing to operate two units.

“It is part of the ongoing consolidation to extend the ability of the hospital to keep its doors open,” said spokesman Chuck Finnie.

Sherry Ray, a nurse who works in the department and attended Wednesday’s hearing, said the closure came as a surprise during her shift.

“They sent us home and said our next shifts were canceled,” Ray said.

Plaintiffs’ attorney Pamela Price mentioned the closure of the unit during her appeal to Orrick as another example of the hospital’s “death by dismemberment.”

Attorneys for Contra Costa County and the West Contra Costa Healthcare District, which runs the hospital, said they agreed with Orrick’s tentative ruling that there is no legal basis for an injunction.

Both attorneys also added that their clients have done much to keep the hospital open, that they are continuing to work behind the scenes for a solution, and that they were upset by charges by the plaintiffs of discrimination.

“They think nothing of accusing my clients of discriminating without any factual evidence,” Douglas Straus, an attorney representing the health care district, said of the accusation that the district was discriminating against African-Americans by reducing services at the hospital.

Otto Warmbier was arrested in January 2016 at the end of a brief tourist visit to North Korea. He had been medically evacuated and was being treated at the University of Cincinnati Medical Center when he died at age 22.