Thousands of Californians will have marijuana offences wiped from their records now that voters have eliminated criminal penalties, state officials have said.

California voters approved recreational adult use in 2016 and stores selling the drug opened their doors at the start of January. The San Francisco District Attorney’s Office announced that it would retroactively apply marijuana legalisation to every case since 1975, meaning more than 3,000 misdemeanours could be erased and sealed.

Prosecutors will also review nearly 5,000 felony marijuana convictions to potentially apply new sentences, District Attorney George Gascón said.

“Long ago we lost our ability to distinguish the dangerous from the nuisance, and it has broken our pocket books, the fabric of our communities, and we are no safer for it,” he said in a press release.

“A criminal conviction can be a barrier to employment, housing and other benefits, so instead of waiting for the community to take action, we’re taking action for the community.”

He characterised the move as reflecting the will of San Francisco voters, who overwhelmingly voted in favour of legalisation.

In pictures: 4/20 Marijuana world rallies Show all 26 1 /26 In pictures: 4/20 Marijuana world rallies In pictures: 4/20 Marijuana world rallies A man wears a marijuana leaf mask during the annual 4/20 cannabis culture celebration at Sunset Beach in Vancouver, British Columbia AP In pictures: 4/20 Marijuana world rallies A lady smokes marijuana on Parliament Hill on 4/20 in Ottawa, Ontario Getty Images In pictures: 4/20 Marijuana world rallies James Reed smokes a joint during the Denver 420 Rally at Civic Center Park in Denver, Colorado Getty Images In pictures: 4/20 Marijuana world rallies People sign a 4/20 sign on Parliament Hill on in Ottawa, Ontario Getty Images In pictures: 4/20 Marijuana world rallies A woman smokes marijuana on Parliament Hill on 4/20 in Ottawa, Ontario. Polling released showed strong support in Canada for a government drive to legalise recreational use of marijuana, but many would like the proposed minimum age for consumption to be raised. Sixty-three percent of respondents told the Angus Reid Institute they support legalisation Getty Images In pictures: 4/20 Marijuana world rallies A man smokes marijuana during the annual 4/20 marijuana rally on Parliament Hill in Ottawa, Ontario, Canada Reuters In pictures: 4/20 Marijuana world rallies Demonstrators smoke marijuana during the '4/20 Santiago' rally in favour of legalisation in front of the La Moneda presidential palace in Santiago, as part of the Global Marijuana March which is being held in hundreds of cities worldwide Getty Images In pictures: 4/20 Marijuana world rallies People play with a mock marijuana joint during a 4/20 party to demand legalisation and to celebrate marijuana culture outside the Senate building in Mexico City, Mexico Reuters In pictures: 4/20 Marijuana world rallies Adam Eidinger, co-founder of DCMJ, hands out free marijuana joints to DC residents who worked on Capitol Hill as part of the 1st Annual Joint Session to mark '4/20' day and promote legalising marijuana on Capitol Hill in Washington, DC Getty Images In pictures: 4/20 Marijuana world rallies In pictures: 4/20 Marijuana world rallies Police arrest Rachel Ramone Donlan after she handed out free marijuana joints to DC residents who worked on Capitol Hill as part of the 1st Annual Joint Session to mark '4/20' day and promote legalising marijuana on Capitol Hill in Washington, DC AFP/Getty Images In pictures: 4/20 Marijuana world rallies Police arrest Rachel Ramone Donlan after she handed out free marijuana joints to DC residents who worked on Capitol Hill as part of the 1st Annual Joint Session to mark '4/20' day and promote legalising marijuana on Capitol Hill in Washington, DC Getty Images In pictures: 4/20 Marijuana world rallies Thousands of people gather to smoke marijuana during the '420 Santiago'rally in front of the La Moneda presidential palace in Santiago Getty Images In pictures: 4/20 Marijuana world rallies People attend the Denver 420 Rally at Civic Center Park in Denver, Colorado Getty Images In pictures: 4/20 Marijuana world rallies Kevin Barron and Lasean Moore of Raleigh, North Carolina, share a joint during the Denver 420 Rally at Civic Center Park in Denver, Colorado Getty Images In pictures: 4/20 Marijuana world rallies Nic Ruhl takes a pull on a giant hand rolled joint at precisely 4:20pm MDT during the Denver 420 Rally at Civic Center Park in Denver, Colorado Getty Images In pictures: 4/20 Marijuana world rallies Various cannabis paraphernalia on display at a vendor's stall during the Denver 420 Rally at Civic Center Park in Denver, Colorado Getty Images In pictures: 4/20 Marijuana world rallies Mo Banez, of Austin, Texas, lights a joint during the Denver 420 Rally at Civic Center Park in Denver, Colorado Getty Images In pictures: 4/20 Marijuana world rallies A man displays a large container of cannabis during the Denver 420 Rally at Civic Center Park in Denver, Colorado. The rally, held annually, is a celebration of both the legalisation of cannabis and cannabis culture. Colorado is one of twenty-six U.S. states along with the District of Columbia that has legalised the use of cannabis either recreationally or medically AFP/Getty Images In pictures: 4/20 Marijuana world rallies Sitting in small groups on mats shaded by trees in the Rose Garden just across from the Knesset, participants lit up as the clock struck 4:20 for the local version of the traditional worldwide April 20 pro-marijuana events, known as '420' rallies Getty Images In pictures: 4/20 Marijuana world rallies An Israeli smokes a marijuana joint in Jerusalem during a rally at the Rose garden Getty Images In pictures: 4/20 Marijuana world rallies Sitting in small groups on mats shaded by trees in the Rose Garden just across from the Knesset, participants lit up as the clock struck 4:20 for the local version of the traditional worldwide April 20 pro-marijuana events, known as '420' rallies Getty Images In pictures: 4/20 Marijuana world rallies An Israeli girl poses with a mock marijuana joint in Jerusalem during a rally at the Rose garden, to celebrate 420 and to express their defiance of current laws Getty Images In pictures: 4/20 Marijuana world rallies aelis pass around a marijuana joint in Jerusalem during a rally at the Rose garden, to celebrate 420 and to express their defiance of current laws Getty Images In pictures: 4/20 Marijuana world rallies An Israeli smokes a marijuana joint in Jerusalem during a rally at the Rose garden, to celebrate 420 and to express their defiance of current law Getty Images In pictures: 4/20 Marijuana world rallies An Israeli smokes a marijuana joint in Jerusalem on April 20, 2017 during a rally opposite the Knesset to celebrate 420 and express defiance of current laws AFP/Getty Images

While the law allows marijuana offenders still serving their punishments to apply for re-sentencing, and permits past offenders to seek to have their records reduced or dismissed, the state reported that it had received only 4,885 petitions as of December.

A similar effort was already underway in San Diego County, where District Attorney Summer Stephan said a review initiated just after the election had already granted relief to some 680 people. The county focused on people who were on probation or still in custody, she said, with some people released from incarceration as a result.

“We took the will of the people and were able to in an expeditious manner affect the lives of those that were the most affected”, she said.

Republican politician steps down after saying black people more susceptible to marijuana

In announcing the review, Mr Gascón specifically lashed out at the Trump administration, contrasting San Francisco’s direction with the fact that “drug policy on the federal level is going backwards”.

Attorney general Jeff Sessions has long been sceptical of loosening marijuana laws, characterising cannabis as a dangerous substance, and he recently rescinded the hands-off federal approach to legal marijuana states that had prevailed during the Obama era.