Public Defender Jeff Adachi, left, has called on Mayor Ed Lee, right, and the Board of Supervisors to fund a unit to defend undocumented immigrants from deportation in the case that President-elect Donald Trump follows through on his campaign promises. (Jessica Christian/S.F. Examiner)

With its undocumented residents under threat from President-elect Donald Trump, San Francisco may soon be paying $5 million to defend immigrants from deportation.

The Public Defender’s Office proposed Wednesday the creation of a unit to defend undocumented immigrants in court beginning in January. The proposal is part of a greater push by city officials to keep San Francisco a sanctuary city, where law enforcement agencies are limited in their cooperation with immigration authorities.

Public Defender Jeff Adachi’s proposal for “universal representation in immigration cases” is a direct response to Trump moving into the White House in two months. There are an estimated 30,000 undocumented immigrants in San Francisco, according to Adachi.

“We see this as an emergency measure,” Adachi said. “Again, the Trump administration has indicated it will be acting very swiftly in terms of noncitizens.”

San Francisco has been at the center of much of Trump’s rhetoric against sanctuary cities. While still a candidate for the Republican nomination, he blasted such policies following the July 1, 2015, death of Kathryn “Kate” Steinle at San Francisco’s Pier 14, allegedly at the hands of an undocumented immigrant and convicted felon who had been released by the Sheriff’s Department. Trump has threatened to punish cities with sanctuary policies once he becomes president.

In response, San Francisco officials, including Mayor Ed Lee — like many Democratic counterparts across the nation — have been circling the wagons against a possible immigration crackdown after Trump’s inauguration. Lee has pledged to defend San Francisco’s sanctuary status even if it means a loss of federal funds. The proposed expansion of the Public Defender’s Office to fight deportations is another such effort.

As adamant as Lee has been about defending the policy, Steinle’s death resulted in charged debate among city officials over how to handle undocumented felons in the criminal justice system. Sheriff Vicki Hennessy, the mayor’s pick in the November 2015 election, rose to power partly on the pledge to re-examine the department’s communication protocol with federal immigration officials.

Since Trump’s election, Lee has insisted San Francisco will remain a sanctuary city and also promised to protect the information of undocumented immigrants, earning support from his usual opponents.

“San Francisco provides funding for services, legal representation and support to immigrant communities dealing with deportation and naturalization issues,” Mayor’s Office spokesperson Deirdre Hussey said in a statement. “This is, and will always be, part of our commitment as a sanctuary city.”

Supervisor John Avalos said he hoped that Lee’s impassioned defense of The City’s sanctuary policy this week will withstand the pressure in the coming months. “In the back of my mind, I worry that Lee could cave in,” he said. “I would like to think that the mayor knows that Fox News and Breitbart News are coming to focus on San Francisco.”

Trump has said he wants to deport up to 3 million undocumented immigrants living in the U.S.

At a news conference at UC San Francisco Mission Bay on Thursday, Lt. Gov. Gavin Newsom said that estimates show there are not 3 million undocumented felons in the nation, meaning Trump would need to deport nonfelons to reach his goal.

Adachi’s proposal would pay for about 30 lawyers to fight for those facing deportation, 10 of whom would work in the Public Defender’s Office, which already employs 93 attorneys. The lawyers in the Public Defender’s Office would specifically focus on cases of detained individuals.

“What we are asking the mayor and the Board of Supervisors is for 30 to 40 attorneys in our office and nonprofits who would provide direct legal representation to noncitizens who are facing removal or deportation,” said Adachi.

As it stands, federal immigration courts have a 25,000 case backlog in San Francisco alone, according to Adachi.

Adachi’s proposal is, in part, modeled after a first-of- its-kind universal representation program established in New York City in 2013. The New York Immigrant Family Unity Project offers free legal representation to anyone in New York City facing immigration actions.

The $5 million program is run by several public defender’s offices and paid for by New York City.

While undocumented immigrants are not entitled to attorneys, some nonprofit organizations like The Bar Association of San Francisco have legal resources available.

Remarking on the apparent rise of hate crimes since Trump’s election, Supervisor Eric Mar said he supports the proposal as a way for San Francisco to “put its money where its mouth is.”