DENVER on Wednesday became the first US city to decriminalise psychedelic mushrooms, as voters approved a ballot initiative by a razor thin margin.

The new ordinance loosens restrictions on the personal use and possession of psilocybin mushrooms, also known as “magic mushrooms,” by people over the age of 21.

The new law, however, does not make it legal to buy, sell or possess the drug. It instructs police officers to treat psilocybin users as their lowest priority.

Although the measure earlier appeared headed for defeat, by late afternoon on Wednesday the numbers showed a reversal of fortune with Initiative 301 set to pass with nearly 50.6 percent of the vote.

“It’s been one hell of a 21 and a half hours,” Kevin Matthews who led the decriminalisation campaign, told the Denver Post after the vote results were announced.

“If these results hold, this is an example of the absurd comedy of the great metaphor. Against all odds, we prevailed. This is what happens when a small team of dedicated and passionate people unite under a single idea to create change.”

Officials said the vote would be certified on May 16 once all military and overseas ballots have been counted.

Proponents of the new law point to studies that say psilocybin is not considered addictive and could be used against depression or opioid addiction, which causes thousands of deaths in the US each year.

“Humans have used these mushrooms for thousands of years for healing, rites of passage, spiritual insight,” said the organisation Decriminalize Denver, headed by Matthews, which in January announced it had collected enough signatures to put the measure to a vote.

Adoption of the new law once again puts Colorado at the forefront of US drug legalisation after it became one of the first two states to legalise marijuana in 2012.

“Denver is quickly becoming the illicit drug capital of the world. The truth is we have no idea what the long-term health effects of these drugs are going to do to the people of Colorado,” Jeff Hunt, an official at Colorado Christian University, said on CNN after the referendum on mushrooms was announced.

Marijuana is now legal for recreational use in 10 US states, including California, while more than half of the 50 states allow its use for medical purposes.

Last year, a similar measure to decriminalise psilocybin mushrooms in California failed to gain enough signatures for inclusion on the ballot.