Law enforcement officials in California have accused federal agents of using a gang investigation as a cover for detaining undocumented immigrants.

“I want to underscore that we would never have participated or cooperated in this operation if we had known that it included immigration enforcement,” Santa Cruz Police Chief Kevin Vogel said at a news conference earlier this week. Santa Cruz is a sanctuary city for immigrants.

“As a result of this betrayal of trust, we will be taking a long and hard look about whether we will cooperate with this federal agency in the future,” he said. “We can’t cooperate with a law enforcement agency we cannot trust.”

The raids were launched Feb. 13 against local gang MS-13, which includes members from El Salvador. Police had been investigating the gang for years. Vogel noted that 10 individuals suspected of extortion, drug trafficking and murder had been arrested in Santa Cruz, Daly City and Watsonville.

“I want to very clear today, that the only reason members of the Santa Cruz police participated in this operation was to arrest violent gang members,” Vogel said. DHS officials “assured” police that the operation did not have an “immigration component,” he added.

But police discovered later that DHS officials “had acted outside of the scope of this operation and had detained and removed a number of individuals from various locations based upon their immigration status,” Vogel said, noting that these people “may or may not have been related” to the criminal investigation.

The police chief said several people were secretly removed from areas that didn’t have police on the scene and sent to DHS sites in other counties for processing, according to ABC-7 TV.

“The detention and the removal of these individuals based solely upon their immigration status flies in the face of the City Council resolution declaring Santa Cruz a place of trust and safety for all local immigrants,” Vogel said at the press conference. “The community has an absolute right to be angry about this.”

A DHS spokesman denied the police had been duped.

“Allegations that the agency secretly planned an immigration enforcement action in hopes there would be new political leadership that would allow for an alleged ‘secret’ operation to take place are completely false, reckless and disturbing,” James Schwab said in a statement. He also said 11 people had been detained over immigration issues alone, and that 10 already had been released.

Vogel said last week that the police department had yet to receive any specifics or documentation about the number or identity of people detained. Based on their own information sources, however, Santa Cruz officials believe at least 10 people were detained over immigration status alone, and that six were released with GPS tracking devices so that they could be located for upcoming court cases, according to Assistant Santa Cruz Police Chief Dan Flippo.

Santa Cruz isn’t the only city that was antagonized by the DHS and federal Immigration and Customs Enforcement agents this week. Los Angeles officials have written a letter to ICE demanding that immigration agents stop calling themselves “police.” The practice undermines the police department’s years of work building trust in the city’s large immigrant community, according to a letter signed by LA Mayor Eric Garcetti, the city attorney and City Council president.

An ICE spokeswoman said in response to the letter that immigration agents can “initially identify themselves as ‘police,’” although they also wear badges saying “ICE,” the Los Angeles Times reported.

CORRECTION: An earlier version of this piece said Gil Garcetti is the mayor of Los Angeles.