A standoff Monday at a UPS facility in Gloucester County in which a gunman took his ex-girlfriend and another woman hostage ended with police killing the gunman and freeing the women, who were not harmed, police said.

Though it was not known at the time, the man, identified by police as William Owens, 39, of Sicklerville, had a history of domestic violence. The incident is a reminder of the role intimate-partner violence often plays in gun incidents, from threats to mass shootings.

Women are more likely to be killed at work by a domestic partner than by any other cause. In 2015 and 2016, about 40 percent of the women killed at work were slain by a relative or partner, compared with 2 percent of men, according to the Bureau of Labor Statistics.

A new law in New Jersey allows family members to take out restraining orders against relatives who they fear pose a threat. Under the gun violence restraining order law, signed by Gov. Phil Murphy last year, family members can ask a judge to temporarily take away the person’s weapons.

The risk of a woman’s being killed by her abusive partner increases by five times if the partner has access to a firearm, according to the National Coalition Against Domestic Violence, which estimates that 4.5 million American women have been threatened with firearms by their partners. Thirty-five percent of all women killed by men are killed by intimate partners with guns.

In November, three people were killed in a shooting at Chicago’s Mercy Hospital and Medical Center. The gunman went to the hospital to confront his former fiancée, an emergency room doctor, about breaking off their engagement. After killing her, he was killed by police but also shot himself.

Domestic violence has had a role in the majority of recent mass shootings. Between 2009 and 2017, more than half of gunmen shot a partner or family member as part of their crime, according to an analysis by Everytown for Gun Safety. Often, the shooter has a history of domestic violence, as in Orlando, Las Vegas, and Sutherland Springs, Texas.

The Philadelphia region also has had recent high-profile domestic-related murders, including those perpetrated by Bruce Rogal in Chester County and Bradley Stone in Montgomery County against family members — in both cases, the men were angry at ex-wives.

Domestic violence has been one of the priorities of gun-control groups hoping to pass state and federal legislation. They have pushed amending federal law to include dating partners and stalkers (not just spouses, parents, or cohabitants) in regulations that keep guns from domestic abusers.

Last year, Pennsylvania passed a bill tightening regulations on gun possession by people convicted of domestic abuse.

“Domestic violence is a scourge on our society, and these reforms will go a long way to protect victims, hold abusers accountable, and keep guns out of the hands of dangerous individuals,” Gov. Tom Wolf said in October when signing the bill.