Federal immigration agents arrested a man in front of San Francisco’s Hall of Justice this week, prompting outrage from the city’s public defender and district attorney.

The man, identified only as a San Francisco resident, was in front of the criminal courthouse at 850 Bryant St., on his way to a hearing, when agents took him into custody on Tuesday, according to the public defender’s office and the man’s attorney, Emi MacLean.

MacLean declined to name the man on Thursday or give details about his arrest but said he’s detained at the Mesa Verde Detention Facility in Bakersfield.

“He is a longtime resident of San Francisco who was showing up, as he should, to a criminal court appearance,” said MacLean, who called the arrest “outrageous.”

Officials with U.S. Immigration and Customs Enforcement said the man is an undocumented immigrant from Mexico who has three felony convictions for second-degree burglary and multiple arrests on his record. The agency said it issued several detainers, a request to hold the man, with local law enforcement following his arrests but that they were ignored, allowing the man to be released back into the community.

ICE did not name the man.

His arrest revived the debate over sanctuary jurisdictions and how far they should go to protect undocumented immigrants. San Francisco officials have said they refuse to cooperate with ICE or honor detainers, a decision that has made the city a focal point of the national immigration debate.

A detainer or immigration hold — which differs from a judicial warrant — is a written request by ICE to a local jail or law enforcement agency to detain an undocumented immigrant arrested on criminal charges for an additional 48 hours after his or her release.

The intent is to give ICE time to arrest the individual and begin deportation proceedings, but some courts have deemed the tactic unconstitutional.

This follows the arrests of at least two immigrants at the Sonoma County Superior Court last month, which outraged politicians and community advocates who say courthouses must be deemed safe spaces. They fear these arrests will deter immigrants from reporting crimes or acting as witnesses in criminal cases.

This is likely the first time ICE has arrested someone at a San Francisco courthouse, officials said. ICE has said it has federal authority to make arrests as it sees fit, no matter the location. The agency has criticized sanctuary jurisdictions such as San Francisco for protecting undocumented immigrants, arguing they are compromising public safety.

“Criminals like this individual are released to re-offend again and again,” ICE San Francisco Field Office Director David Jennings, said in a statement Thursday.

“A simple phone call to ICE to arrange the secure transfer of such individuals would serve the hard-working residents of the city far more than a misguided sanctuary policy that, as proven here and numerous times in the past, goes to great lengths to protect criminals under the guise of protecting the citizenry.”

Local law enforcement arrested the man at least seven times in the past five years, according to ICE. The agency issued eight detainers for the man — most recently in October — but they were ignored, ICE said.

The Trump administration said it will ramp up arrests as it continues to crack down on illegal immigration, particularly in jurisdictions that do not cooperate with ICE. It’s unclear if the courthouse arrests are part of this increased enforcement.

“It’s showing the increasingly lawless behavior of immigration authorities,” MacLean said. “It’s the reason why in San Francisco and in many other jurisdictions there’s been a strong statement that ICE is not welcome here.”

The agents did not have a judicial warrant, a violation of state law, the public defender’s office said.

“California law explicitly forbids a civil enforcement agency, including ICE, from making a civil arrest without a warrant outside a courthouse,” San Francisco Public Defender Mano Raju said in a statement. “ICE’s illegal conduct undermines community trust and public safety. This type of action scares people — including victims, witnesses, the accused, or those participating in treatment — and deters them from coming to court.”

Raju said his office will “provide immediate and zealous representation to anyone subject to such illegal activity.”

San Francisco District Attorney Chesa Boudin also condemned the action.

“ICE actions in or near our courthouses deters people from accessing our justice system, making us all less safe,” he said.

The public defender’s office said it plans to hold a news conference on the steps of the Hall of Justice on Monday and share more information about the case.

Tatiana Sanchez and Evan Sernoffsky are San Francisco Chronicle staff writers. Email: esernoffsky@sfchronicle.com, tatiana.sanchez@sfchronicle.com. Twitter: @EvanSernoffsky, @TatianaYSanchez