They’d been camping out for the permit, but the eventual winner came in through a different door.

After waiting nearly a month outside a city building in hopes of hosting the next 4/20 marijuana celebration in Civic Center Park, employees of the dispensary Euflora saw their hopes dashed early this morning as a rival beat them by mere seconds to lay claim to a crucial city permit.

“We’ve been here for 27 days. I’m absolutely heartbroken,” said Bobby Reginelli, marketing director for Euflora.

He says his company’s attempt to take over the controversial event was derailed by the city’s “botched” process, which forced the applicants into an actual footrace through a city building. He also contends, with video evidence, that he was not allowed to use the same door as the competition.

Now, the permit is set to go to Michael “Smokey” Ortiz, a friend of the same group that the city had tried to ban from throwing the event.

This is a huge deal for the cannabis industry.

Tens of thousands of people converge on downtown Denver each year for the smoke-out, which has had headliners as big as Lil Wayne and 2Chainz.

The city tries to control the event by forcing the organizers to apply for a permit each year. Only one person gets the permit, which gives them the right to bring in vendors, musical artists and more.

Cannabis activist Miguel Lopez has held the permit for years, but it went up for grabs at 8 a.m. today because the city recently banned Lopez from throwing the event. The city contended that this year’s rally was mismanaged, which Lopez disputes.

Meanwhile, Pepe Breton, co-founder of the “boutique” Euflora chain, saw an opportunity. Knowing that the city was likely to offer the lucrative permit on a first come, first serve basis, he paid staff to start camping outside a city building on Oct. 25 at 4:20 p.m.

Their plan was derailed at the last moment.

Euflora staff spent day and night outside a door of the Wellington Webb building. They were confident of victory early this morning.

“We are the champions!!!” Reginelli texted to a reporter at 5:21 a.m. “There is no one left down here. They saw our determination and turned back around. The permit is ours. Now it’s only simply a matter of walking through the doors at 7 am and signing the forms.”

But they weren’t done yet. In fact, the line to get the permit didn’t officially open until early this morning at a counter inside the building. The doors would open at 7 a.m., and whoever got to the desk first would get to claim the profit.

Ortiz raced in from a different door than the Euflora staff, beating them by mere steps, they said. The city honored Ortiz as being first and will give him the permit unless he fails to meet any requirements. City staff formally rejected the Euflora team’s application.

Reginelli said the Euflora team was treated unfairly.

He said that building security forced them to wait an additional two minutes longer than Ortiz. Moreover, he said that Ortiz was allowed to enter the building through a door that they weren’t allowed to use.

“We had everything locked. Locked is an understatement,” Reginelli said.

Starting late on Monday night, he had deployed three people to the south door of the building and two more on the north corner. At 2:30 a.m., a security guard “evicted” the Euflora team from the south door, Reginelli said. He provided video of a security staffer explaining that it would be considered “loitering” if they stayed at the south entrance, and that the “official entrance” was on the other side.

And yet Ortiz — their only rival — returned to that door and was allowed to stay.

Reginelli claims that Ortiz lied to a security guard in order to keep his spot at the forbidden door. Euflora staff heard Ortiz claim that he was waiting for a different permit. Asked about this, Ortiz answered obliquely.

“Hey, it’s the okey-doke, I’m a magician. You say look over here, this is what I’ll tell you — but hey, you don’t ever show nobody all your tricks,” he said.

City spokeswoman Cyndi Karvaski said that Reginelli’s description of the events was accurate, “from what I understand.”

Who is Ortiz?

Ortiz pretended to smoke a joint in the faces of demoralized Euflora staff as he exited the permit office. Leaving the building, he explained that he is part of a worldwide organization, the Global Marijuana March.

“We do different events around the world. We’re trying to free the hemp plant, trying to get rid of plastic, paper, all trash,” he said, also referring to connections to the “Rainbow Hippie Family.”

Santino Walter, who has been the 4/20 event manager in recent years, was present and grinning as he watched the drama play out. Ortiz said he’s a friend of Walter and Miguel Lopez, but they claim there is no business connection.

Ortiz and Walter exchanged an exuberant high five and left the building together after getting the permit.

“I think this is a great guy to get it. I’m going to let him focus and dominate this thing. We’re really proud,” Walter said.

Euflora hasn’t decided its next step.

“This process is absolutely broken. This is the most convoluted, unbelievable disgrace of a process. We were disenfranchised,” Reginelli said. “They are picking an unknown candidate when we have been in here for the past month, every day.”

Lopez still plans to fight in court to retain the event permit for himself, he said via text.

Correction: This story in one instance referred to the permit “being in the hands” of Ortiz. The final permit hasn’t been issued.