As Iowans prepared to engage in the latest iteration of their decades-long stranglehold on America’s presidential nominating contests Monday, there was reason for optimism. A halfway-formidable field of Democratic candidates had debated at length on everything from the merits of sweeping policy changes like junking private health insurance to who had the best shot at unseating Donald Trump. A bitter impeachment fight was still raging in Washington, but for one night, at least, the sweet, sweet stuff of grassroots activism might win out at union halls and gyms in corn country.

Instead, it was a disaster that allowed Trump—quite reasonably—to declare himself the winner.

The caucuses on Monday were marked by chaos, with an apparent deluge of technical problems and the patently absurd mechanics on display throughout the evening. By the following morning, there were still no official results announced, prompting a flood of credible prognostications suggesting the extremely white state might finally lose its first-in-the-nation mantle.

“I think we are witnessing the end of the Iowa caucus for real this time,” one campaign official told The Daily Beast.

The problems were blamed on the new app designed to report caucus results back to the party. In a statement on Tuesday, the Iowa Democratic chairman said results had been collected by the app but a coding error meant they were not being reported correctly.

Local officials have voiced their fury at the state party, claiming that they were warned last week that there were serious problems with the technology. Sean Bagniewski, chairman of the Polk County Democratic Party, told The Washington Post that local officials had been aware of problems with the app since last Thursday.

Bagniewski said local teams received no training on how to use the app, struggled to download it or obtain the PIN numbers they needed to log in, and were placed on hold for hours on end when they tried to call the result in via an old-fashioned phone hotline instead.

Shawn Sebastian, the caucus secretary for a Story County precinct, live-tweeted his predicament: trying to call in results for six delegates and being put on hold for well over an hour.

“I don't think this is a way to do democracy,” he wrote. “I was just following the rules and this is the outcome the rules got us. If I can ever get the results reported... still on hold.”

Joe Biden’s campaign fired off a letter to the party, citing “considerable flaws” in the system. “The app that was intended to relay Caucus results to the Party failed; the Party’s back-up telephonic reporting system likewise has failed. Now, we understand that Caucus Chairs are attempting to—and, in many cases, failing to—report results telephonically to the Party,” it said.

The rules for the caucuses changed this year to create not one, not two, but three sets of results. These would include initial preference for president as well as final vote alignments and official delegate counts.

Various reports suggested that the problems in declaring these results came from the software powering the app going rogue. The state Democratic party denied a hack and insisted it was just being extremely diligent and trying to reconcile what it vaguely referred to as “inconsistencies.”

But caucus officials were left waiting on a backup hold line from hell as campaigns tried to figure out what was going on. As Sebastian, the caucus secretary, waited patiently, he took a second to chat with CNN’s Wolf Blitzer, and lost his spot in the queue. Des Moines County party chair Tom Courtney declared the app “a mess.”

It was perhaps fitting that, around 11:30 p.m., when some candidates began delivering speeches and calling it a night, caucus secretaries showed signs of doing the same thing.

And as it became clear that there would be no victor announced by night’s end, elected Democrats began letting their frustrations show.

The technical failings came on top of the usual issues thrown up by the Iowa caucuses, which inspire alternating expressions of joyous wonder and eye rolling. There are questions over how lower-case-d democratic a process can be when it relies on people lobbying each other on a crowded high school basketball court. But reports of pettiness and frustration were especially acute Monday.

The Washington Examiner’s Philip Klein reported around 10 p.m. that Iowa frontrunner Bernie Sanders had cleaned up in overall support in one precinct, but equal numbers of delegates for him and a handful of the other candidates were somehow announced.

This year’s caucus appeared to be especially egregious when it came to straight-up Uncut Gems-style nonsense helping determine the next president of the United States. A coin was literally tossed in the air as several caucuses struggled to come up with their candidate for the Democratic nominee to be president.

Yes, the delegates from the state that has long provided election-winning momentum to presidential candidates were, over and over again, being awarded based on coin tosses and names being pulled from hats.

The Iowa caucuses traditionally propel one candidate—such as Barack Obama in 2008—into the national spotlight, allowing them to generate headlines and the kind of momentum that can fire them towards clinching the nomination.

Such was the chaos on Monday that the president was able to ridicule the entire Democratic party and declare himself the winner.

“The Democrat Caucus is an unmitigated disaster,” he wrote on Twitter on Tuesday morning. “Nothing works, just like they ran the Country ... The only person that can claim a very big victory in Iowa last night is ‘Trump.’”

—With reporting from Sam Stein