Gov. Janet Mills on Friday signed legislation to expand background checks and invest in mental health services following the Lewiston mass shootings in October. 

The bill, brought forward by the governor, requires background checks for advertised sales of firearms and makes it a felony to sell a firearm to someone who is prohibited from having one. 

It also changes the current yellow flag law to allow law enforcement to go directly to a judge for a protective custody warrant and remove weapons if they believe there’s a risk of harm. 

In addition, it establishes an Office of Violence Prevention at the Maine Center for Disease Control and Prevention and allocates funds for crisis receiving centers in Lewiston, Penobscot County and Aroostook County. 

“Violence is not a simple problem, nor is the remedy a single, simple measure,” Mills said in a statement. “The measures in this law are not extreme or unusual, or a cookie cutter version” of laws in other states. 

Two other gun-related bills passed by the Legislature are still awaiting action by Mills — a 72-hour waiting period between the purchase and pick up of a firearm and a ban on bump stocks that modify weapons to make them shoot more bullets more quickly.