Voters in Denver, a city at the forefront of the widening national debate over legalizing marijuana, have become the first in the nation to effectively decriminalize another recreational drug: hallucinogenic mushrooms.

The local ballot measure did not quite legalize the mushrooms that contain psilocybin, a naturally occurring psychedelic compound. State and federal regulations would have to change to accomplish that.

But the measure made the possession, use or cultivation of the mushrooms by people aged 21 or older the lowest-priority crime for law enforcement in the city of Denver and Denver County. Arrests and prosecutions, already fairly rare, would all but disappear.

Results posted by the city as a “final unofficial” tally late on Wednesday showed the “Yes” vote won by less than 2,000 ballots. The “No” vote had led throughout the day, until the last updated count by elections officials. Alton P. Dillard, the elections spokesman, said the passage appeared safe, but the final results would not be certified until May 16.