Correction: This story has been updated to correct a quote from Rockville Council member Beryl Feinberg.

Agents with U.S. Immigrations and Customs Enforcement carry out arrests earlier this year. (Charles Reed/AP)

The Rockville City Council has narrowly approved an ordinance restricting police from cooperating with federal immigration authorities or asking residents about citizenship status — a victory for advocates who saw similar measures die in Annapolis and vetoed in Howard County earlier this year.

The “Fostering Community Trust” ordinance, passed on a 3-to-2 vote Monday, breaks no new ground. But it codifies existing Rockville police force practices that are designed to keep local law enforcement at arms length from deportation and other federal actions that spawn fear in immigrant communities.

Montgomery County police follow similar guidelines, but elected leaders there have opposed legislative action that would put those practices into law, especially at a time when President Trump is vowing to step up deportations and punish jurisdictions that do not cooperate.

Officials in Rockville, a suburb of 65,000 residents that is the Montgomery County seat, found themselves catapulted into the center of the national debate on immigration and crime last March after two undocumented Latino teenagers were charged with raping a 14-year-old classmate in a boys bathroom at Rockville High School.

The charges have since been dropped. But the incident triggered a firestorm of commentary and criticism — including from the White House and Gov. Larry Hogan (R) — about whether the city and school system had done all they could to protect students.

Local officials and advocates for immigrants said such criticism unfairly tarnished all undocumented immigrants and implied that such individuals were disproportionately involved in criminal behavior.

Council member Julie Palakovich Carr, who sponsored the ordinance passed Monday night, said she wanted to send an important message to immigrant communities: that local police are there to protect them, not to tip off federal agents about who may be deportable.

“This is meant to set the tone and direction for our city,” said Carr, who was joined in supporting the measure by council members Virginia Onley and Mark Pierzchala.

Mayor Bridget Donnell Newton and council member Beryl Feinberg opposed the ordinance. Newton called it “a solution looking for a problem.” Feinberg offered an amendment calling instead for a specific policy to be drafted by the police chief and city manager.

“Laws shouldn’t be drafted for political agendas or symbolism,” Feinberg said.

The vote followed more than two hours of public comment from both opponents and supporters of the ordinance.

Rockville resident Gail Weiss, referring to the title of the measure said: “Respectfully, the only trust you should be concerned with fostering is that of citizens.”

Ray Jose, who identified himself as undocumented, turned away from the council and faced the audience to say that the law was needed. Despite established practice, he said, he’s seen collaborations between police and federal immigration authorities that bring “psychological terror to communities like mine.”