Gov. Mark Dayton signed a bill into law Monday that will allow prosecutors to arm themselves while on duty.

The legislation, drafted after a courthouse shooting that nearly killed Cook County Attorney Tim Scannell last December, would allow prosecutors who have legal carry permits to carry during the workday. A quirk in the state law banned prosecutors from carrying weapons while on duty, but had no such restrictions for judges or public defenders.

Courthouses will still have the right to ban guns from courtrooms and courthouse ground, lawmakers were assured during debate on the bill. Supporters of the legislation said the old restrictions prevented them from keeping guns in their cars or office, and made it difficult to field work-related calls on their days off. Scannell was shot in his office, reportedly by a defendant he had just prosecuted.

Dayton also signed off on three bills that passed the legislature with unanimous support: one that allows automated drug distribution in certain healthcare facilities; one that establishes Medicaid reimbursement for some services provided by paramedics; and a Minnesota Comprehensive Health Association policy bill.

The governor also vetoed an asbestos liability bill.