The ghost-gun bill calls for barring the purchase of separate parts or kits that could be used to manufacture a firearm that cannot be traced by law enforcement.

"This 'do-it-yourself' method of assembling these 'ghost guns' allows the owner to avoid the laws and regulations that are meant to keep firearms out of the hands of those who pose a danger to themselves or others,'' Democratic state Sen. Joe Cryan said in a statement.

Lawmakers said the part of the inspiration for the legislation stemmed from the 2017 case of a northern California rampage that resulted in the deaths of five people, in addition to the gunman. Authorities said they believed the two high-powered rifles were made by the gunman.

It is already unlawful to make a handgun, rifle or shotgun without a license, and manufacturing a machine gun, sawed-off shotgun or assault firearm is also illegal.

The measure would make the purchase of firearm parts to manufacture an untraceable firearm a third-degree crime, punishable by a three- to five-year prison sentence, a fine of up to $15,000, or both.

Scott Bach, the executive director of the New Jersey Rifle and Pistol Clubs, which supports Second Amendment rights, said his group is still reviewing the measure and declined to comment.