ANNAPOLIS, Md. (AP) — Maryland’s legislature has given final approval to a bill that would eliminate criminal charges for possessing small amounts of marijuana, and the governor says he plans to sign it.

The Senate voted Monday to accept several compromises the House added over the weekend.

The bill would keep marijuana use illegal but make it akin to a traffic violation. The House opted to require all teen offenders to be evaluated for treatment. It also voted to raise the penalties to $250 for a second offense and $500 for a third, up from a maximum fine of $100.

Gov. Martin O’Malley, a Democrat, said Monday he has changed his views on decriminalization. He says it reflects the public’s will and could lead to greater focus on more serious threats to public safety.