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

More than 8,000 pot cases in San Francisco since 1975, including felony convictions, will be dismissed through an automated clearance system.

The announcement came after San Francisco District Attorney George Gascón said last year that he would apply California’s recreational marijuana legalization law retroactively.

In a news release, Gascón’s office said the 8,132 cases announced Monday included misdemeanor and felony possession and use convictions.

Gascón’s office had already cleared 1,230 such cases, but the latest dismissals were identified after his office partnered with a local nonprofit, Code for America. Together, they developed a system that can evaluate if thousands of convictions should be dismissed in a few minutes, the release said.

Previously, offenders had to petition the court themselves in a process that the release described as “time-consuming, expensive, and confusing.”

“Prosecutors should act to address the inherent unfairness of penalizing people for activity that is no longer illegal,” Gascón said, according to the release.

The release said the city's clearance system could easily be adopted by counties across the state.