CONCORD, N.H. — Gov. Maggie Hassan signed a new law creating a domestic violence statute in a private ceremony Thursday with the mother of a 9-year-old boy who was killed by his father.

The bill was introduced following the killing of the boy, Joshua Savyon, who was shot to death last year as he spent time with his father at a Manchester YWCA. His father, who also killed himself, had said he was upset over custody arrangements and had threatened to kill his mother or himself and the boy.

“This critical public safety measure that I signed into law today was spurred in part by the tragic loss of 9-year-old Joshua Savyon. Joshua’s mother, Becky, has shown remarkable courage in sharing her story and advocating for this law,” Hassan said in a statement.

Joshua’s Law, which takes effect Jan. 1, doesn’t change the substance of the crimes but will help distinguish an assault that occurred in a bar fight, for example, from one that involves an attack on a spouse. Making domestic violence a crime will allow the state to collect better data that can be used for prevention, education and intervention.

Supporters say the distinction is important because domestic violence often escalates. In the past decade, half of the murders in New Hampshire were related to domestic violence, as were more than 90 percent of the murder-suicides.

People convicted of certain misdemeanor offenses under state, federal and tribal law lose the right to purchase or possess guns and are placed on a federal registry. The crime must include the use of physical force, an attempt at it or the threatened use of a deadly weapon. It must also involve a current or former spouse, parent or guardian of the victim. Other relationships that trigger the placement on the federal registry include sharing a child in common or living with the victim currently or in the past as an intimate partner.