ALBANY — Gov. Andrew Cuomo signed legislation Monday that will further decriminalize marijuana possession in New York and wipe certain convictions from a person's criminal record.

The law, which takes effect in 30 days, was proposed during the waning hours of the state's 2019 legislative session as it became clear a proposal to fully legalize the drug lacked enough votes to pass. It was seen as a compromise between those who oppose legalizing a commercial market for marijuana and those who seek to undo the harms of prohibition.

"Communities of color have been disproportionately impacted by laws governing marijuana for far too long, and today we are ending this injustice once and for all," Cuomo said. "By providing individuals who have suffered the consequences of an unfair marijuana conviction with a path to have their records expunged and by reducing draconian penalties, we are taking a critical step forward in addressing a broken and discriminatory criminal justice process."

New York first decriminalized small amounts of marijuana in 1977, making possession of up to 25 grams (nearly an ounce) a violation punishable by fine rather than a misdemeanor punishable by jail time. But it contained a loophole: Anyone who used even small amounts of marijuana in a public place or in "public view" could be arrested and charged with a criminal offense, rather than a violation.

This loophole led to the arrests of thousands of people each year — mostly people of color. In 2015, for example, 88 percent of the 16,590 people arrested for possessing small amounts of marijuana in New York City were black or Latino.

The new law closes this loophole by making the penalties for public or private possession the same.

It also effectively doubles the amount of marijuana someone can possess before being charged with a crime. Possession of up to two ounces (57 grams) of marijuana is now a violation subject to fine.

The fines are smaller too. Possession of up to two ounces could net someone a fine of up to $500 under the old law. Under the new law, the maximum fine will be $200.

"Decriminalizing marijuana is an essential part of reforming our state's broken justice system," said Senate Majority Leader Andrea Stewart-Cousins. "For too long, communities of color have been disproportionately targeted and negatively impacted."

Decriminalization is not the same as legalization. Penalties for buying, selling, trading or growing marijuana would remain, and a black market would continue to exist. Under full legalization, New York would create a system to grow, process, regulate and sell the drug for recreational use.

While further decriminalization will likely reduce overall penalties, proponents of full legalization believe it will do little to end racial disparities in the way the state's marijuana laws are enforced.

"The racial disparities that we've seen since 1977 with enforcement are a cautionary tale of the ways in which decriminalization falls short," said Melissa Moore, New York state deputy director for the Drug Policy Alliance, a nonprofit dedicated to ending the war on drugs. "Officers will still have discretion, and anytime you leave discretion as the primary avenue through which law is enforced you see racial disparities go up."

People can still be arrested and separated from their children for marijuana offenses, she said, and will still face parole and probation violations. Additionally, she said the immigration consequences for some people found guilty of a marijuana violation remain severe — an individual could be deported or become ineligible for legal immigration status.

Jawanza James Williams, director of organizing at VOCAL-NY, a nonprofit dedicated to social justice, said many advocates viewed the decriminalization bill as "an abject failure." In addition to decriminalizing possession, sale and other aspects of the marijuana trade, full legalization can be used to redirect tax revenue to communities hardest hit by the war on drugs, he said.

"The legacy of issues that have hit black, brown and poor people as a result of marijuana prohibition is more wide ranging than any decriminalization bill could ever remotely come close to addressing," he said.

The new law does create a process to automatically expunge certain low-level marijuana convictions from a person's criminal record. As of mid-June, there were 5,601 convictions for unlawful possession of marijuana that would be eligible for expungement in Albany, Rensselaer, Schenectady and Saratoga counties, according to data from the state Division of Criminal Justice Services.

Individuals can also petition to have the records destroyed.

Nearly 600,000 New Yorkers have an arrest record for possessing small amounts of marijuana, according to a message of justification attached to the legislation.

The costs associated with these arrests total hundreds of millions of dollars to taxpayers each year, according to research by the ACLU and Queens College sociologist Harry Levine.

Arrest records can impact a person's ability to access banking services, schools, jobs, housing, certain licensing and also have immigration consequences, according to the National Employment Law Project.

"By removing the barriers and stigma that come with these records, we clear the path for many New Yorkers to find a job, housing and go on to live successful and productive lives," said Assembly Speaker Carl Heastie.