Mayor Kenney on Wednesday lashed out at a proposed law that targets the city's policy of giving sanctuary to undocumented immigrants, calling it "incredibly dangerous."

The legislation from Rep. Martina White (R., Phila.) would essentially make illegal the city's policy, which bars nearly all communication between local law enforcement and federal immigration authorities.

"In a year where we have already seen too much violence, this bill would make it even more difficult to solve and prevent crimes," Kenney said in a statement. "Not only would it make undocumented residents far less likely to report or to act as a witness to a crime, this bill would weaken the trust between police and the communities they serve."

White's bill, which passed out of a House committee Tuesday, would bar municipalities from passing legislation that limits cooperation between public officials and the federal government on immigration cases. Those with such legislation could have state funding withheld.

The bill also would hold such a municipality financially responsible for any damages to a person or property resulting from criminal activity by illegal immigrants, who in the legislation are called unauthorized aliens.

Sen. Pat Toomey (R., Pa.) has hammered the policy for months, making the issue a key one in his bid for reelection against Democratic challenger Katie McGinty in one of the most closely watched Senate contests in the country.

Supporters of the policy say it builds trust between law enforcement and undocumented immigrants, easing fears that contact with police could lead to deportation.

Critics worry that the policy endangers the public. Recently, they have highlighted the case of Ramon Aguirre-Ochoa, an illegal immigrant who was released by Philadelphia police despite a federal detainer request and who in July was charged with raping a child.

"I can think of no better example of the dangerous consequences caused by Mayor Jim Kenney's reckless sanctuary city policy, which is an open invitation to criminals who know they will be protected from deportation," White said in a statement in August.

The city has said officials would have turned over Aguirre-Ochoa had federal officials received a warrant for his having violated a deportation order.

Kenney on Wednesday accused White, through the legislation that would withhold state funding, of hurting "the very people" she "claims to be protecting."

"If the city failed to comply with this incredibly dangerous law, we would lose funding for thousands of our most vulnerable children," he said. "If Rep. White wants to help those children, she needs to spend less time helping the Republican Party dog-whistle and more time working on school funding so that our children can actually have a safe, stable learning environment."

tnadolny@phillynews.com215-854-2730 @TriciaNadolny