OLYMPIA, Wash. — Law enforcement would be notified if someone fails a background check after trying to buy a gun, as would victims with protection orders, under a measure signed Wednesday by Washington Gov. Jay Inslee.

The new law, which takes effect in July, requires gun dealers to notify the Washington Association of Sheriffs and Police Chiefs, also known as WASPC, within five days of a denial. The Washington State Patrol must then incorporate that information into its electronic database, accessible to the state’s law enforcement agencies.

“This will not just keep guns out of the hands of those who are not eligible to have them, but keep the public and our law enforcement officers safe,” Inslee said as he signed the bill.

Background checks screen buyers to make sure they aren’t a felon, a fugitive, or in the country illegally, among other disqualifiers. But currently, there’s no requirement that there is any follow up if someone lies and tries to buy a gun.

The new law allows WASPC to establish a grant program that would allow local law enforcement to conduct investigations into people who illegally tried to get a firearm.

“We want there to be criminal consequences if you knowingly, illegally try to purchase a firearm,” said Democratic Rep. Drew Hansen, a sponsor of the measure. “There’s no mechanism for that to happen right now. This bill creates that mechanism.”

The measure also requires the creation of a statewide notification system so that those who have stalking, sexual assault, domestic violence or other court protection orders against someone can be automatically notified if the person they have the court order against tries and fails to buy a gun.

Paula Harwood, 52, had testified in support of the bill as it worked through the Legislature, and joined other advocacy groups at Inslee’s side Wednesday. After the bill signing, she recounted how scared she was to learn her abusive ex-husband had tried and failed to buy a gun. Even though she had a protection order against him, the only way she learned about it was from a reporter who had been previously writing on the background check law.

She said that having an official notification system is “a matter of life and death.”