Denver is set to become the first city in the United States to effectively decriminalize the psychedelic substance in “magic mushrooms,” but only after it appeared the ballot measure would fail in a tight race.

The measure, sponsored by a group of citizen activists, appears to have passed Wednesday by a 1.12 percent margin, according to NBC-affiliate KUSA. The move underlines Denver’s role in shaping the national conversation around drug policy.

The city decriminalized marijuana possession in 2005, and seven years later Colorado followed suit at the state level.

Supporters of the initiative touted the drug’s use in alleviating symptoms of mental health issues. The push was led by a former cadet at the U.S. Military Academy at West Point who said the substance, psilocybin, dramatically alleviated his major depression.

Initiative 301, as it was known locally, effectively changes city code to say that enforcing laws for possession of psilocybin mushrooms by people 21 or older “shall be the lowest law enforcement priority in the City and County of Denver.”

It appeared late Tuesday night that the decriminalization would fail with 52 percent of voters rejecting it, but late final ballot counting inched it just above passing. If the the results hold, they will officially be certified May 16.

But the bill still won't fully legalize the hallucinogenic.

It will still be illegal to possess “magic mushrooms,” and sales of the drug will still be considered a felony. The federal government, which outlawed psilocybin in 1968, classifies it as a Schedule I drug with “no currently accepted medical use and a high potential for abuse.”

“Denver is quickly becoming the illicit drug capital of the world,” Jeff Hunt, director of the Centennial Institute at Colorado Christian University, a conservative think tank, told the Los Angeles Times ahead of the vote.

Mayor Michael Hancock, who reportedly opposed the initiative according to the Washington Post, did not return a call from NBC News.

The city’s district attorney, Beth McCann, also opposed the initiative, partly because the city is still trying to understand the effects of marijuana decriminalization, both at the local and statewide level, according to her spokeswoman Carolyn Tyler.