Efforts to legalize marijuana in New York state have failed, so lawmakers did the next best thing: Decriminalize it.

The Staten Island Advance reports the New York State Senate passed a bill Thursday to decriminalize small amounts of recreational marijuana in the Empire State. The legislation decriminalizes possession of less than two ounces of pot and establishes procedures to expunge most criminal records for marijuana-possession misdemeanors.

As many as 600,000 New Yorkers -- mostly black and Latino -- may benefit from the expungement of past marijuana convictions, according to the Associated Press.

“In New York State, people of color are disproportionately arrested for marijuana possession," New York State Senator Jamaal Bailey (D-Bronx), who sponsored the bill, said. “The misdemeanor charge for public view of marijuana possession gives those people convicted a criminal record that will follow them throughout their lives, potentially limiting their access to housing, access to education, affecting their ability to obtain employment, all leading to a potential inability to provide for their families."

Bailey called decriminalization a “step in the right direction in finally ending the heavy-handed war on drugs that has decimated communities of color."

Legalization would have allowed possession of weed and set up a legal framework for growing, producing and retailing, along with setting taxes on cannabis products. Eleven other U.S. states have already done the same.

But Gov. Andrew Cuomo said that he was informed the Senate did not have enough votes to legalize marijuana.

“I said from the beginning of this session that I believed marijuana legalization had the best chance of being passed in this year’s budget,” Cuomo said in a statement. "Communities of color have been disproportionately impacted by laws governing marijuana for far too long and it has to end.

“I understand the desire to end session today as planned, and will give the legislature a message of necessity to expedite passage if required. This legislative proposal is not new. I first proposed this decriminalization measure in 2013, and again in this year’s budget. The time to act is now.”

Cuomo said in January he wanted to legalize adult recreational marijuana use before the end of the 2019 legislative session Thursday, but said he was open to decriminalization as an alternative.

The New York Post reports Cuomo plans to sign the decriminalization bill into law as early as Friday.