The 89th Academy Awards was pretty conventional, as far as Oscars ceremonies go. Host Jimmy Kimmel did a respectable job guiding proceedings along, with some jokes landing and others falling flat. There were plenty of references to current politics and criticisms of the Trump administration, but on the whole they were fairly restrained. Tears were shed, family members were thanked, and clip montages were shown.

Then, just as everyone was getting ready to turn in for the night, following an unsurprising Best Picture win for La La Land, things took a turn for the flabbergasting. With La La Land's filmmakers and cast assembled on stage, producer Jordan Horowitz stepped up to the microphone to announce the actual winner - Moonlight.

The screw up essentially boils down to a case of two envelopes being accidentally swapped, and presenters Warren Beatty and Faye Dunaway being handed the Best Lead Actress envelope instead of Best Picture. Accounting firm PricewaterhouseCoopers, who handle the Oscar vote count, have since issued an apology for the error, but the hubbub is certain to grow even bigger once those who slept through the Oscars wake up to the news.

It's difficult to imagine a more devastating mistake, but for such a massive mix-up, the way it played out was probably the best case scenario. The worst case scenario, from a PR standpoint, would have been if the positions were reversed and Team Moonlight had been forced to hand over the Oscar to La La Land exactly one year after #OscarsSoWhite took social media by storm.

Make no mistake, this was a bad way for things to go down. It left Beatty and Dunaway humiliated through no fault of their own, robbed Moonlight's filmmakers and cast of the kind of elation they might have enjoyed with an uncomplicated win, and was an unpleasant sucker punch that La La Land's cast and crew had to react to on stage, in front of the cameras. It was weird, awkward, confusing... and exciting. It will probably be the most talked-about Oscars moment for years to come. At the risk of being crass, it was great television.

Already conspiracy theories are flying that the whole affair was scripted, which in itself is a testament to how well it worked out, relatively speaking. The moment even felt like the feel-good ending of a sports movie: the scrappy underdog believing they've failed to surpass the bookies' favorite, only to be told that they've actually won after all. Moonlight's fortune is La La Land's misfortune, but La La Land had already enjoyed plenty of fortune of its own over the course of the evening, including a Best Director win for Damien Chazelle and a Best Lead Actress win for Emma Stone. A Best Picture win would have been the cherry on top, but even without it La La Land still has the rest of the cake to enjoy.

Above all, what saves this screw up from being a full-blown disaster is the fact that no one involved comes off badly - there is no villain in this story. The envelope swap was the result of accident, not malicious intent or carelessness on the part of Beatty and Dunaway, and the announcement of Moonlight's win was made with brisk grace by Horowitz, who stepped up to take charge amid all the confusion. Horowitz has been widely praised for his handling of the situation, including a tribute on Twitter by Moonlight director Barry Jenkins.

Jordan Horowitz. Wow. I'm slipping slowly into reflection, perspective. Much respect to that dude— Barry Jenkins (@BandryBarry) February 27, 2017

La La Land and Moonlight were not vicious rivals. Neither film has been particularly mired in controversy, and there are plenty of people who liked both (La La Land has suffered from some backlash to the initial hyperbolic praise, but Moonlight has yet to experience its own wave of haters). Speaking in a post-awards press conference, Emma Stone was ebullient in her endorsement of Moonlight's win:

"I f***ing loved Moonlight. God, I love Moonlight so much! I’m so excited for Moonlight! And, of course, it was an amazing thing to hear La La Land. I think we all would have loved to win Best Picture. But we are so excited for Moonlight. I think it is one of the best films of all time."

The Oscars have been struggling against falling ratings for some time, and last night's stunning mistake not only has people all over the world buzzing about the drama, but also serves as a reminder of why people tune in for the Oscars: for the pomp and ceremony, for the powerful emotional reactions as people's dreams come true (or don't), and for all the things that could potentially go wrong.

Next year's Oscars host is definitely going to be spoiled for material.

Next: Why Moonlight Won the Oscar for Best Picture