In what was a Hollywood ending to this year's biggest award show, Moonlight won the Oscar for Best Picture—but only after La La Land was mistakenly announced as the winner.

When it happened, many people didn't know how to react; producers from La La Land were actually mid-speech before executives from the Academy clarified the error. And what an error it was, almost on a par with the infamous Steve Harvey mixup from 2015's Miss Universe pageant.

Once the night's real winner was announced, La La Land producer Jordan Horowitz took charge to congratulate Moonlight for its achievement. It was an odd, shocking end to what was a relatively tame show, which saw Suicide Squad win an award for best hair and makeup.

What happened?

Well, it wasn't actually the fault of presenters Faye Dunaway and Warren Beatty, who were at the center of the embarrassing snafu. When the Best Picture envelope was opened, Beatty took an awfully long time to read who had won, instead demurring to Dunaway, who eventually proclaimed La La Land the winner.

However, the presenters were actually handed the envelope for Best Actress, which went to La La Land's Emma Stone. That's why Beatty was so hesitant to read it aloud in the first place. He got the opportunity to explain what happened, but it was still an epic mixup.

The night's ending was made even more dramatic by the realization that La La Land actually lost Best Picture, which it was favored to win. Instead, the award was given to Moonlight, a fantastic drama directed by Barry Jenkins about a black man growing up in Miami. It was a deserved win, although it was slightly overshadowed by the weird Oscars mistake.

It's unclear how the wrong envelope ended up in Beatty's hand but you can bet the mixup won't be repeated next year. You can watch the screwup in the video above.