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 contentious measure that would block public officials from immediately releasing the names of officers involved in such incidents.

The measure, sponsored by State Rep. Martina White (R., Phila.) and approved by the GOP-controlled legislature, stoked sharp opinions.

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

"We are the protectors of our protectors," said one proponent, State Rep. Dom Costa (D., Allegheny), a former Pittsburgh police chief.

Opponents said the bill flies in the face of transparency, which they believe is critical in police-involved shootings.

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

Wolf has not said whether he will sign the bill. Civil libertarians said a law could be the first of its kind in the United States.

State law now lets local officials determine when to publicly identify an officer who has used force.

Under the legislation, 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. Violators could be charged with a second-degree misdemeanor.

The Attorney General's Office and district attorneys would be exempt.

The law would supersede current policy in Philadelphia, where the Police Department typically discloses names of officers involved in shootings within 72 hours if there are no credible threats to those officers. A department spokesman on Thursday would say only that if the bill became law, Philadelphia police would follow it.

The Pittsburgh Police Department generally does not identify officers involved in shootings unless they are charged with a crime. Officer Robert Swartzwelder, president of the Fraternal Order of Police Lodge 1 there, called the proposal fair.

"There's an obligation by society to protect its police officers as well," he said. "The police put their lives on the line to protect the public, and they don't lose their rights because they put on a badge."

Elizabeth Pittinger, executive director of the Pittsburgh Citizen Police Review Board, a city-funded independent watchdog, called the bill chilling. "Gagging a public official from disclosing a police officer's identity and then criminalizing a public official's accountability to the public is outrageous," she said.

Critics also complained that Republican legislators pushed through a controversial measure on their last expected voting day without a full airing.

White's bill was approved, 151-32, with many Philadelphia-area lawmakers against it. In the Senate, it passed 39-9.

The legislature has enough votes to override a Wolf veto, but would have to take the unusual step of reconvening for votes after Election Day to do so.

717-787-5934 @AngelasInk

Jonathan D. Silver of the Pittsburgh Post-Gazette contributed to this article.