From her bench, U.S. District Court Judge Yvonne Gonzalez Rogers stared at an assistant U.S. attorney representing the Department of Homeland Security. “I’m finally seeing you in person,” she told him during a hearing last week in Oakland.
Jevechius Bernardoni responded sheepishly. “Yes, your honor,” he said. Bernardoni had been summoned before the District Court for the Northern District of California in haste, after the government seemingly disobeyed an order from Gonzalez Rogers. In response, the judge issued a rare threat to hold the government in contempt. Looking down upon him from her high seat, she wasn’t hiding her annoyance.
The government lawyer would be right to feel his prospects were poor that day in court. The Northern District of California is one of the few places where Immigration and Customs Enforcement is not winning much. Over the last year in wood-paneled rooms in San Francisco, Oakland, San Jose, and McKinleyville (just north of Eureka), representatives of President Donald Trump’s Department of Justice have found themselves on their heels. In an avalanche of cases brought by Bay Area attorneys, these courts have issued a slew of rulings that have stymied the administration’s immigration policies locally.
Gonzalez Rogers threatened to hold the DHS in contempt for defying her order not to deport a migrant woman. Without telling the judge, the agency had placed the woman in expedited removal proceedings. In a hearing set for Feb. 24, she would have to convince a DHS employee that she deserved to stay in the U.S. If she failed the interview, she could be deported within days.
Gonzalez Rogers massaged her temple and shook her head. She asked why the government had disobeyed her order not to attempt to deport the woman. Bernardoni’s explanation was Kafkaesque: The judge’s initial order prohibited DHS from detaining the migrant again; it didn’t explicitly preclude deporting her.
The argument was unpersuasive. “You cannot circumvent the protections that have been afforded [by this court],” Gonzales Rogers said. She ordered Bernardoni to make sure DHS would not proceed with expedited removal proceedings against the migrant. She gave the government a day to respond.
“I’m not waiting for you anymore,” she told the assistant U.S. attorney.
“I was unsurprised by the government lawyer’s argument,” Jordan Weiner, the attorney representing the migrant woman, later told The Standard. “Overall, I think the government attorney’s noncompliance with the order was less about flouting the order and more about willful ignorance.”
The next day Bernardoni answered the judge. DHS would postpone its interview with the migrant. For a moment, the court had stopped the gears of the deportation machine.
‘San Franciscans are resilient’
The scene in Gonzalez Roger’s courtroom was but the latest act in a months-long drama in which Bay Area lawyers have fought dozens of ICE detentions in court. Leading the effort is a legal community of nonprofits and private lawyers working pro bono, with financial support from the city of San Francisco and the state of California, a coalition that has emerged in the year since the Trump administration began enacting its mass deportation campaign.
One of the main tools these lawyers have is to petition for writ of habeas corpus, a right embedded in the U.S. Constitution that affords the incarcerated a chance to challenge the legality of their detention. According to HabeasDockets.org (opens in new tab), these petitions have been persuasive; more than 80 habeas corpus orders have been issued by Northern District of California courts since January 2025. Some extracted migrants from detention just hours after ICE arrested them. Weiner, the interim executive director at La Raza Centro Legal in San Francisco, has won many habeas orders and is currently litigating more than 30 such cases.
This mirrors a national trend of habeas petitions being filed in unprecedented numbers. According to an analysis by ProPublica (opens in new tab), 20,000-plus habeas petitions were filed in the first year of Trump’s second term, more than in the last three administrations combined.
The habeas cases apply to individuals, but the Northern District of California Court has also issued a number of wider-reaching orders. On Christmas Eve, San Francisco federal court Judge Casey Pitts ordered an end to ICE’s practice of arresting migrants at the city’s immigration court. In the order (opens in new tab), Pitts slapped down the government by saying it “entirely failed to provide a reasoned explanation for … concerns about chilling effects and access to justice.”
Since that order was issued two months ago, ICE has not detained anyone at San Francisco’s immigration court.
Also in December, Pitts issued an order prohibiting ICE from keeping detainees in holding cells on the sixth floor at 630 Sansome St. Those cells were designed to hold detainees for 12 hours at most but had been used to hold migrants for days. The detainees were forced to sleep on the concrete floor and were unable to shower or receive medical care.
The latest order might be the court’s farthest-reaching. On Feb. 10, Judge Maxine M. Chesney ordered ICE to provide effective medical care, warm blankets, and access to lawyers to those held at the California City Detention Facility, the agency’s largest detention facility in the state. Opened hastily in August inside a shuttered state prison two hours north of Los Angeles, the facility has drawn attention for its harsh conditions, which California Attorney General Rob Bonta called “unsafe and inadequate.”
The Northern District of California ordered the California City Detention Facility, the state’s largest ICE detention center, to provide better medical care and warm blankets. | Source: Marcio Jose Sanchez/ Associated Press
Located in the Mojave Desert, California City Detention Facility is one of the closest long-term detention facilities to the Bay Area, 350 miles away. “ Every single woman who gets detained by ICE in the Bay Area will be taken to California City,” said Steven Ragland of Keker, Van Ness & Peters, one of the lead attorneys on the case brought before Chesney. While ICE has several long-term detention centers in the state, California City is the only one that holds women.
Ragland says members of the Bay Area’s legal community aren’t scared of Trump’s threats of counter litigation, which helps to explain the number of successful cases against the administration. “ San Franciscans are resilient and not easily intimidated,” Ragland said. “We have lawyers here who will bring the cases.”
Compared with other parts of the country, the Bay Area has an abundance of private firms and nonprofit legal organizations funded by the state and the city of San Francisco that are fighting the Trump administration in federal court. The San Francisco Immigrant Legal Defense Collaborative, for example, consists of 16 nonprofits that provide legal services to undocumented people, funded by the San Francisco Mayor’s Office of Housing and Community Development. In December, Mayor Daniel Lurie signed a Board of Supervisors’ supplemental budget appropriation of $3.5 million to fund legal aid groups.
Private attorneys are contributing as well. Lawyers at corporate firms in San Francisco have worked pro bono on individual habeas cases as well as on class action suits. Ragland’s firm took on its first habeas immigration case last summer, when a distressed man walked into the office pleading for help because his sister had just been detained by ICE at SF immigration court nearby.
This ecosystem of lawyers often collaborates on filings in federal court. In the California City case, four organizations and 14 lawyers were listed as counsel for the plaintiffs. On class actions especially, more hands is an advantage. “We’ve filed dozens of motions,” said Jordan Wells, an attorney with the Lawyers’ Committee for Civil Rights who is working on the California City class action. “We have to interview potential plaintiffs and file legal briefs requested on tight timelines. It’s just more and more work. You need a big team.”
Often, the government has a single lawyer defending the actions of DHS’ immigration enforcement. And sometimes that lawyer has little experience in immigration law. In one habeas case, Weiner said, the lawyer for the government had been reassigned and had never practiced immigration law. “I almost felt bad for the guy,” she noted.
Wells has seen similar inexperience in the habeas cases he’s litigated in federal court over the last year. “ I’ve definitely had opposing counsel from the U.S. attorney’s offices that don’t have any background in immigration,” he said. “[They] are just being thrown on these cases.”
‘Spaghetti against the wall’
Winning a court order against the Trump administration in SF federal court and compelling the government to comply with a judge’s order are two different challenges. While ICE has mostly obeyed habeas orders to release individual migrants from detention, other court orders have been slow-walked or even outright ignored.
When the court ordered ICE to stop detaining people in those sixth-floor holding cells on Sansome Street, the agency responded by moving detainees down to similar cells on the fifth floor.
“The court was not pleased about that,” said Wells. “They’re always looking for ‘What is the stingiest reading of what the court is telling us to do?’” He compared the behavior to the administration’s refusal to honor a federal judge’s order to turn around a flight of migrants deported to El Salvador in February 2025.
Because the administration had not followed previous SF federal court orders to improve conditions at the California City Detention Facility, the order issued by Chesney on Feb. 10 included the appointment of a monitor to ensure compliance.
Even in the habeas cases, which have been a bright spot for immigration rights advocates, the government seems to always look for a way to skirt the court’s intention.
“ It’s a little chaotic,” Weiner said. “ I’ve seen the immigration attorneys move to dismiss the immigration cases and then put them in expedited removal. [They’ve also] said [they’re] gonna deport you to a third country, like Ecuador or Guatemala, even if you’re not from there. I think what’s happened in practice is the government is throwing spaghetti against the wall, trying a bunch of different things.”
In May, recognizing that federal courts could hinder the administration’s mass deportation program, White House adviser Stephen Miller suggested outright suspending the writ of habeas corpus for undocumented people. The idea drew swift backlash even among Republican allies of Trump. The administration never moved to end habeas.
But Weiner worries that despite the limited success she and other Bay Area attorneys have had at San Francisco’s federal court, the administration’s willingness to flaunt the rules might render the local victories temporary.
“The government is doing such dramatic things at such frequency that I think we’re just going to lose everything eventually if things continue at this pace,” she said. “We’re winning the battles but losing the war.”