Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

SAN FRANCISCO — San Francisco's district attorney said Wednesday that city prosecutors will toss out or reduce thousands of criminal convictions for marijuana dating back decades, a move allowed under the 2016 state ballot measure legalizing recreational sales of pot.

District Attorney George Gascón said his office will dismiss nearly 3,000 misdemeanor cases and review nearly 5,000 felony cases for possible action.

Proposition 64 legalized the recreational use of marijuana. It also allowed people convicted of marijuana charges to petition courts to toss out the cases or reduce penalties.

Gascón says that process can be time-consuming and costly, so prosecutors in the district attorney's office plan to review and wipe out eligible cases en masse. Some people with convictions may not know they are eligible, Gascón said.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Related: Recreational marijuana in California among 2018’s new laws

"A misdemeanor or felony conviction can have significant implications for employment, housing, and other benefits," Gascón said. He said prosecutors will review cases from 1975 through passage of Proposition 64 in November 2016.

He said 23 petitions for dismissal or reduction have been filed in San Francisco since passage of Proposition 64.

As of September, around 5,000 people had applied for a change to their records, according to state data. That's a fraction of the people that experts estimate are eligible.

Laura Thomas, deputy state director for the pro-marijuana organization Drug Policy Alliance, estimated more than 100,000 people are eligible to have their records changed.

Assemblyman Rob Bonta, a Democrat from Oakland, introduced legislation on Jan. 9 that would require county courts to automatically expunge eligible records.

Recreational marijuana became legal in California last year, and on Jan. 1 it became legal for licensed dispensaries to sell it to non-medical patients.

Related: Californians embrace new pot law with long lines

The U.S. Justice Department announced earlier this year that it's halting an Obama-era policy to take a hands-off approach toward states that have legalized marijuana. Pot is still illegal under federal law.

The federal move could lead to increased prosecutions of marijuana sellers and growers, although it's unclear how aggressive federal attorneys will be.