HARRISBURG — State senators on Wednesday overwhelmingly approved a measure that would tighten gun access for people convicted of some domestic-violence crimes — effectively ensuring it will become law and marking the first time in several years that legislators passed new restrictions on gun possession.

The bill, which also applies to people covered under final protection-from-abuse orders, requires people it covers to surrender their guns within 24 hours of a court ruling in their cases. Gov. Wolf promised to swiftly sign the bill, calling it "commonsense and urgently needed reform."

"We know that too many families are being torn apart by domestic violence and too many domestic abusers use firearms to kill, injure, and terrorize their victims," the governor said in a statement. "The reforms passed today are long overdue and will make important strides to protect victims and reduce violence."

Of the 117 people killed in Pennsylvania as a result of domestic violence last year, 78 were shot, according to statistics kept by the Pennsylvania Coalition Against Domestic Violence. Philadelphia had 13 domestic-violence deaths in 2017, and Allegheny County had 10, according to the coalition's statistics.

Supporters of the bill, approved on a vote of 43-5, have described it as one of many steps needed to temper a domestic-violence problem that is killing too many people in the state, while critics have said they fear the bill infringes on people's constitutionally protected right to bear arms.

The bill applies to two sets of people in slightly different ways: It narrows the window in which people convicted of misdemeanor domestic-violence crimes — such as assault or terroristic threats — have to surrender their firearms. People with those convictions currently have 60 days to hand over their guns. This bill would give them 24 hours to do so.

The bill also makes it mandatory for people who are subject to "final" protection-from-abuse orders to surrender their guns as well. Current law leaves that up to a judge's discretion. A "final" PFA — which typically lasts for a maximum of three years — can only be granted by a judge, usually after a hearing.

In both cases, the bill also closes loopholes in the law that allow people to surrender their guns to family members or friends. The bill requires them to surrender guns to law enforcement, a dealer, or their attorney.

The bill was widely supported by domestic-violence groups and law enforcement agencies, although some legislators said their local sheriffs' offices raised concerns about whether they would have the resources to properly maintain guns after they are surrendered.

The bill, which also passed by a wide margin in the House, is likely to head to Wolf for his signature soon. It would become law about six months after he signs it.