Voters on Tuesday made Denver the first US city to in effect decriminalize psilocybin – the psychoactive substance in “magic mushrooms” – adding a new chapter to the city’s role in shaping wider drug policy.

The citizen initiative on the ballot followed the same tack taken by marijuana activists to decriminalize pot possession in the city in 2005. That move was followed by statewide legalization in 2012. A number of other states have since broadly allowed marijuana sales and use by adults.

Though initial results posted on Tuesday night showed the measure to be trailing, final unofficial results on Wednesday indicated it did pass.

Decriminalization led by a slim 51%, according to preliminary figures released by Denver’s election division. As many as 1,300 votes still remain to be counted, but that figure was not enough to swing the vote the other way, a division spokesman, Alton Dillard, said.

Final election results would be released on 16 May, he said.

Psilocybin decriminalization campaign organizers have said their only goal is to keep people out of jail in Denver for using or possessing the drug to cope with depression, anxiety, post-traumatic stress and other conditions.

A vendor bags psilocybin mushrooms at a pop-up cannabis market in Los Angeles. Photograph: Richard Vogel/AP

The initiative would effectively decriminalize use or possession of psilocybin by people 21 and older, making it the lowest enforcement priority for police and prosecutors. The measure does not legalize psilocybin or permit its sale by cannabis businesses.

Kevin Matthews, director of the Decriminalize Denver campaign, said psilocybin has helped him with depression for years.

“This is not something you have to take every day,” the 33-year-old Denver native said. “It provides a lot of lasting benefits, weeks and months after one experience.”

Psilocybin has been outlawed in the US since the 1960s, and some researchers warn that it should only be used under medical supervision and can prompt paranoia and anxiety.

The federal government classifies psilocybin as a schedule I drug, with no medical purpose and a high potential for abuse.

For decades, that status has stymied research into medical uses of psilocybin, but small, closely supervised studies in recent years have found that it can help treat anxiety and depression in cancer patients. Users have described seeing vivid colors and geometric patterns, and experiencing powerful spiritual connections and emotions.

Magic mushrooms have been used in religious practices for decades because of their powerful effect on perceptions and spiritual experiences. Those same effects have appealed to recreational users dating back to the 1960s counterculture movement.

A California effort to decriminalize psilocybin failed to qualify for the statewide ballot in 2018. Organizers in Oregon are trying to gather enough support to put an initiative to a statewide vote next year.

It took the pro-psilocybin organizers in Denver three tries to develop language approved by city officials for the ballot. They collected more than 8,000 signatures to qualify for Tuesday’s election.