(CNN) A federal judge has temporarily blocked the transfer of people infected with the coronavirus to a city in Southern California until a hearing set for this week.

Costa Mesa city filed legal action late Friday against the state of California and various federal agencies after it discovered they were planning to use Fairview Development Center to quarantine patients who've tested positive for the coronavirus.

It said the center is close to residential areas and not suitable to house the patients, citing a risk to public health.

"We learned late Thursday that patients could begin arriving as early as Sunday," Costa Mesa Mayor Katrina Foley said in a statement. "Filing this injunction was the only way to halt the process to allow everyone in Costa Mesa and Orange County to understand the plans in place to protect the patients as well as our community and the region."

The judge's order prevents transportation of anyone infected with or exposed to the coronavirus anywhere in Costa Mesa before a Monday afternoon hearing at the federal courthouse in Santa Ana, the city said in a statement.