Voters narrowly made Denver the first U.S. city to decriminalize psilocybin, the psychoactive ingredient in "magic mushrooms."

Decriminalization led by a slim 51 per cent, according to preliminary figures on Tuesday's election 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, division spokesperson Alton Dillard said.

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

Organizers turned to the same strategy that marijuana activists used 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.

Organizers say their only goal in the mushroom measure 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.

Chris Olson gives drivers a thumbs-up near a busy intersection in downtown Denver on Monday as he urges voters to decriminalize the use of psilocybin. (Thomas Peipert/Associated Press)

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

Kevin Matthews, director of the Decriminalize Denver campaign, said psilocybin has helped him deal 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."

Used in religious practices

Psilocybin has been federally outlawed since the 1960s, when it was widely known as a recreational drug. The ban stymied medical research, but small studies in recent years have found the substance had positive effects on anxiety and depression for cancer patients.

Users have described seeing vivid colours and geometric patterns and experiencing powerful spiritual connections and emotions.

One gram of psilocybin is seen on a scale at New York University. Small, closely supervised studies in recent years have found that it can help treat anxiety and depression in cancer patients. (Seth Wenig/Associated Press)

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 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.

Mayor opposed initiative

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.

Denver Mayor Michael Hancock and District Attorney Beth McCann opposed the initiative, but there was no organized campaign against decriminalization. The city's election largely focused on a six-way race for mayor and a heated effort to end Denver's "urban camping" ban that affects people without housing.

Voters roundly rejected an end to the camping ban. In the mayor's race, incumbent Michael Hancock will face a June 4 runoff election against challenger Jamie Giellis.

The mushroom ordinance also prevents city funds from being used to pursue criminal penalties on possession or use and creates a panel to study the effects of the change.