City councilors have moved to expand a sanctuary city policy by imposing new limits in how Boston Police can handle immigration matters, limiting their ability to share information in civil deportation cases after revelations cops kept working with the feds despite city policies barring it.

“Our police department has a hard enough job without enforcing failed immigration policy,” said District 8 City Councilor Josh Zakim, the lead sponsor on the bill.

City councilors on Wednesday unanimously approved amendments to the city’s 5-year-old Trust Act, further limiting the role police can play in situations that deal with civil immigration matters. The vote comes after a discovery by the ACLU this year that Boston police continued working with federal immigration officials to capture illegal immigrants in spite of policies blocking coordination.

Wednesday’s amendments now specifically prohibit officers from sharing information with the division of ICE focused on civil enforcement matters. Previously officers were blocked from detaining a person solely based on their immigration status.

Mayor Martin Walsh said the amendments aren’t about “taking powers away from the police,” but about underscoring that the priority of Boston Police is public safety, not deportation.

“We want to make sure it’s a good balancing act. It allows the opportunity for people who are immigrants in this city to feel protected and safe, but it also allows our police department to do the job they need to do to keep us safe,” Walsh said.

City councilors scrambled to tie up loose ends in a marathon meeting on Wednesday — their last of the session and the final meeting ever for the four outgoing city councilors: District 9 City Councilor Mark Ciommo, District 5 City Councilor Tim McCarthy, District 8 City Councilor Zakim and City Councilor-at large Althea Garrison.

City councilors also passed new provisions for wetlands protection that bill sponsor and City Councilor-at large Michelle Wu said will provide “climate resiliency and climate justice” as the city continues to develop.

City Council President Andrea Campbell came out of maternity leave just three days after giving birth to urge a vote on her bill to create an office for an independent inspector general to oversee transparency in local government. The bill failed in a 4-9 vote.