ALBANY, N.Y. (AP) — Lawmakers in New York state have voted to eliminate criminal penalties for public possession and use of marijuana after efforts to legalize pot stalled.

The measure would reduce low-level criminal charges for unlawful possession of marijuana to a violation, which comes with a fine similar to a parking ticket. The penalty would be $50 for possessing less than one ounce of pot or $200 for one to two ounces.

In an effort to address decades of racial disparities in drug arrests, the bill would also allow for the expungement of past convictions for possession of small amounts of marijuana.

The state Senate passed the bill Thursday evening a few hours before the chamber adjourned for the year. Passage followed Friday morning in the state Assembly, which planned to adjourn later in the day.

Sen. Jamaal Bailey, D-the Bronx and the bill’s sponsor, said misdemeanor convictions for pot possession can affect a person for life, “limiting their access to housing, access to education, affecting their ability to obtain employment.”

The bill emerged as a fallback option when legislation that would have legalized, regulated and taxed marijuana sales fizzled Wednesday after lawmakers couldn’t reach consensus on key details, such as how tax revenue would be used and how local communities would decide whether they want to host dispensaries.

Lawmakers who had hoped to vote on legalization said the decriminalization bill may be a prelude to full legalization next year.

“We will get there,” said Sen. Diane Savino, D-Staten Island. “This is one step on the path. We will get there.”

New York state began rolling back criminal penalties for marijuana in the 1970s, but current law allowed police to arrest people for having pot in public, a wrinkle that legalization advocates say has often been used to target young racial minorities.

Estimates are that nearly 600,000 New Yorkers could benefit from the expungement of past marijuana convictions.

Opposition to the change was led by Republican lawmakers who said they worried that decriminalizing marijuana would increase traffic crashes and drug use by minors.

Gov. Andrew Cuomo, a Democrat, proposed his own plan for legalization earlier this year. He said he’ll sign the decriminalization bill, noting that he called for a similar step five years ago.

“It’s not legalization,” he said on public radio Wednesday. “But it is decriminalization and it’s a major, major accomplishment.”