HARRISBURG - As cities nationwide grapple with fatal police shootings, many involving unarmed black men, Pennsylvania's legislature on Thursday passed and sent to Gov. Wolf a bill that would block public officials from immediately releasing the names of officers involved in such incidents.

The measure, sponsored by Republican state Rep. Martina White of Philadelphia and approved by the GOP-controlled legislature, stoked sharp opinions and drew votes largely along partisan lines.

Supporters say the bill, supported by several local police unions, is necessary to protect police officers and their families after such incidents.

"We are the protectors of our protectors," said one proponent, Rep. Dominic Costa, a Pittsburgh De   mocrat.

Opponents said the bill flies in the face of transparency, which they believe is even more critical in tragic circumstances involving police shootings.

"Do not undermine the bridges that have been built between law enforcement and communities of color," said Rep. Margo Davidson (D., Delaware) during a floor debate. "This legislation will do nothing but breed suspicion."

Wolf has not said if he will sign or veto the bill.

Current law lets local officials determine when to identify an officer who has used force. Under the bill, public officials would be barred from releasing the name of an officer involved in a shooting until 30 days after the incident, or after an official investigation into it ends.

Anyone who violates the gag could be charged with a second-degree misdemeanor. The state Attorney General's Office and district attorney's offices would be exempt.

The law would supercede current policy in Philadelphia, where the police department typically discloses names of officers involved in shootings within 72 hours after the incident - if there are no credible threats to those officers.

A spokesman for the department on Thursday would say only that if the bill become law, Philadelphia police officials would abide by it.

Critics complained that Republican legislators pushed through such a controversial measure on their last voting day of the year without giving it a full public airing.

White's bill was approved, 151-32, in the House largely along partisan lines, with many Philadelphia-area lawmakers voting against it. In the Senate, it passed 39-9.

Both chambers approved it with veto-proof majorities. If Wolf were to veto it, the legislature would have enough votes to override it, but would have to take the unusual step of reconvening after the election to do so.