The patients involved would be people now quarantined at Travis Air Force Base who have tested positive for the coronavirus but do not have severe symptoms requiring hospital care. Several people confirmed to have the virus are quarantined in their homes across the United States, but that is not an option for some, including people who do not live alone; the authorities are trying to find a secure place for them to stay. Wherever they go, they would be kept away from contact with the public until the danger of contagion passes.

Local officials in Costa Mesa were told of the plan on Thursday night, and filed a request for an emergency injunction in federal court on Friday. The court issued a temporary injunction, pending the hearing on Monday, when a judge will consider whether to extend it.

“Of course we want people to be cared for,” Ms. Foley said in an interview on Sunday. “We just don’t think this is an appropriate site,” she said, noting that it was next to a golf course, a soccer field and a densely populated residential neighborhood.

The mayor, who is running for a State Senate seat as a Democrat, said she was told on a conference call with federal officials on Friday that the military wanted the coronavirus patients moved off all its bases to eliminate the risk that troops would be exposed.

“I don’t want anyone exposed, military or otherwise,” Ms. Foley said.

The city’s 14-page request for a restraining order lists as defendants a group of state and federal actors, including the Defense Department, the Air Force, the Centers for Disease Control and Prevention, the State of California and Gov. Gavin Newsom’s Office for Emergency Services.

“Plaintiffs now seek to prevent Costa Mesa from becoming ground zero to a state and potentially nationwide public health crisis caused because the state and federal governments have not sought to include local officials and emergency personnel in the planning and execution of their efforts,” the city told the court in its filing.

The federal government responded by telling the court that the city’s request was “ill-informed and legally baseless” and that it “endangers the safety and well-being of the American people” by interfering with state and federal efforts to cope with the crisis.