UPDATE with more details: A24’s Moonlight won the Best Picture Oscar tonight after an epic mix-up on the stage in which presenter Faye Dunaway, onstage with Warren Beatty, read what turned out to be the wrong winner. She originally announced that Lionsgate’s La La Land won, to walk away with its seventh win of the night from its record-tying 14 nominations, and La La Land‘s producers even gave acceptance speeches before the mistake was discovered, and chaos ensued for the last and most marquee category of the night as reality set in that the wrong film was announced.

At one point both films’ teams were on the stage as it slowly dawned on the audience at the Dolby Theatre that the switcheroo was no joke. Immediately after the show ended, even Academy officials were unclear about what had happened.

It was a major upset for the top award of the night. Moonlight had gathered two awards — Best Supporting Actor for Mahershala Ali and Adapted Screenplay for writer-director Barry Jenkins based on Tarell Alvin McCraney’s story. Then the indie stepped aside while La La Land racked up six wins, including Best Director for Damien Chazelle and Best Actress for Emma Stone.

“I saw two cards. Things just happen. I wanted to see the card, and Warren [Beatty] refused to show the card to anybody before he showed it to me. And he did—he showed the card,” Jenkins said backstage. “I felt better about what had happened. I will say, the folks from La La Land were so gracious. I can’t imagine being in their position and having to do that. I was speechless because it was so gracious of them to do that.”

Berry Jenkins Jordan Horowitz Oscars
“Moonlight” director Barry Jenkins, left, and “La La Land” producer Jordan Horowitz at the Governors Ball.
Pete Hammond/Deadline

How could the epic mix-up have happened? This is the thinking: Per Academy rules, accountant PricewaterhouseCoopers has two envelopes (two copies) in its charge for every winner. So when they handed the envelope to Dunaway and Beatty, they were given a second one for previous winner Emma Stone for Best Actress rather than the envelope for Best Picture. That’s why Beatty said onstage by way of explaining the mistake he handed the envelope to Dunaway because he was wondering what was going on. Identical suitcases are posted at either side of the Dolby stage in case presenters enter the stage from opposite sides.

It was La La Land producer Jordan Horowitz, in the middle of his acceptance speech, who said, “The winner is Moonlight,” to everyone’s surprise. There were audible gasps in the audience and also backstage. After massive confusion, the Moonlight filmmakers came to the stage. “To hell with dreams because this is true,” said an astonished Jenkins. “My love to La La Land, my love to everyone.”

Horowitz said at the post-show Governors Ball that a stage hand ran onstage to give him the real Best Picture envelope, and he then saw Beatty was holding a Best Actress envelope. ABC’s ABC News and others have been sharing a blown up photo of the envelope in Beatty’s hand during the presentation:

But this came after Marc Platt, who produced the musical romancer with Horowitz and Fred Berger, said from the stage, “Here’s to the fools who made me dream, and thanked everyone from Sam Cohn to his wife of 40 years, Julie. “Repression is the enemy of civilization so keep dreaming,” he said, thinking he had won his first Oscar.

Beatty then took to the stage and the audience and other nominees sat in disbelief. He tried to explain what happened as credits began to roll. Kimmel tried to joke about it saying he knew he’d screw up his first Oscar-hosting job.

This has happened before, according to our colleague Pete Hammond, in 1964, when Sammy Davis Jr. also got the wrong envelope for two music categories. Regardless, the notice posted at the end of the ABC telecast suggests that PwC has a lot of explaining to do: “The results of all the secret voting are known only to the independent accounting firm of PricewaterhouseCoopers until the sealed envelopes are opened on the air.”

A win tonight for Jenkins follows what now was a harbinger big day Saturday at the Indie Spirit Awards when it won six trophies there including Best Feature, Director for Jenkins and Screenplay for Jenkins and McCraney. The film was based on McCraney’s play Moonlight Black Boys Look Blue, divided into three chapters in the life of Chiron — three different actors play the lead role separated by 10 years each.

Set in Miami, the picture offers a melancholic portrait of life in the unromantic suburbs as the main character navigates the crack-riddled streets of his neighborhood and struggles with a complex love for his best friend. Moonlight has been handled deftly by distribution executives at A24 and grabbed the best opening per-screen average of the year at the specialty box office.

“We might have had a couple ideas [for a Best Picture speech], but I think with what went down, we had to roll with it,” Moonlight producer Adele Romanski said. “I felt good about what was said, though I have to admit, it was a fugue state. I don’t remember it.”

Deadline’s Anthony D’Alessandro and Matt Grobar contributed to this report.