Illinois Gov. J.B. Pritzker has signed a law banning firearms advertising that officials determine produces a public safety threat or appeals to children, militants or others who might later use the weapons illegally — opening the door for lawsuits against firearms manufacturers or distributors.

Pritzker on Saturday signed the Firearm Industry Responsibility Act, making Illinois the eighth state to approve legislation that rolls back legal protections for firearms manufacturers or distributors. The legislation comes after the deadliest six months of mass killings recorded in the United States since at least 2006 — all but one of which involved guns.

Pritzker signed the bill alongside lawmakers and gun control advocates at Gun Sense University, an annual training conference of more than 2,000 Moms Demand Action and Students Demand Action volunteers and survivors, hosted by Everytown for Gun Safety.

CHICAGO MAYOR BRANDON JOHNSON ANNOUNCES CURRENT COUNTERTERRORISM HEAD WILL TAKE OVER AS POLICE SUPERINTENDENT

"We hold opioid manufacturers accountable. Vaping companies accountable. Predatory lenders accountable. Gun manufacturers shouldn’t get to hide from the law — and now, they won’t be able to," Pritzker said in a statement.

Semi-auto guns for sale

Semi-automatic guns are displayed for sale at Capitol City Arms Supply on Jan. 16, 2013, in Springfield, Illinois. (AP Photo/Seth Perlman, File))

The law took effect immediately.

ILLINOIS SUPREME COURT UPHOLDS STATE'S BAN ON SALE OR POSSESSION OF SEMIAUTOMATIC WEAPONS

Attorney General Kwame Raoul, a key backer of the law, said "by signing this legislation, Gov. Pritzker has taken an important step to protect consumers and increase public safety."

Democratic state Rep. Jennifer Gong-Gershowitz, the bill's House sponsor, said any companies participating in "depicting guns as tools for carnage" will face serious penalties.

CLICK HERE TO GET THE FOX NEWS APP

Opening the door to such court challenges is part of ongoing efforts by Democratic lawmakers in Illinois and elsewhere to eliminate gun violence, made more complicated by the U.S. Supreme Court’s expansion of gun rights a year ago. Pritzker also signed a ban on semi-automatic weapons this year, a law that gun-rights advocates continue to challenge in federal court.