Faye Dunaway and Warren Beatty presented "La La Land" as the winner of the best picture award, and the celebration began on stage but was quickly ended when one of the "La La Land" winners pointed out that in fact "Moonlight
" had won the award.
Beatty said a moment later that he had opened the envelope and read a card which said "Emma Stone and La La Land." He was confused and paused because of it, he said.
"I wasn't trying to be funny," Beatty explained.
"Moonlight" director Barry Jenkins took to the stage in stunned amazement.
"Very clearly, even in my dreams this could not be true," Jenkins said. "But to hell with dreams, I'm done with it, cause this is true. Oh my goodness."
It was quite the Hollywood ending for Jenkins and his painfully moving coming-of-age drama about a young, gay black man in a rough Miami neighborhood.
Earlier he and original playwright Tarell Alvin McCraney won for best adapted screenplay. The pair paid homage to the disenfranchised in their acceptance speech for that award.
"All you people out there who feel like there's no mirror for you, that your life is not reflected, the Academy has your back, the ACLU has your back, we have your back and for the next four years we will not leave you alone, we will not forget you," Jenkins said.
"Moonlight" star Mahershala Ali also won for best supporting actor.
Despite the mix-up, it was still a good night for "La La Land."
At 32 years old its director, Damien Chazelle, made history Sunday night as the youngest person to ever win best director.
One of his stars, Emma Stone, also won for best actress and thanked Chazelle for the opportunity to appear in his film, which came into the night with 14 nominations.
Casey Affleck won best actor for his performance in "Manchester by the Sea."
Along with the awards, politics and schtick from host Jimmy Kimmel were also in abundance Sunday night.
Kimmel brought tourists into the room and took mean tweets and his mock feud with actor Matt Damon from his show to Hollywood's biggest night.
Kimmel also took swipes at Trump straight out of the gate ("I want to say thank you to President Trump. Remember last year when it seemed like the Oscars were racist? That's gone, thanks to him,") and joked about the diversity this year ("It's been a great year. Black people saved NASA and white people saved jazz.")
It wasn't just Kimmel, though. Some speeches stole the show at moments too.
Viola Davis didn't talk politics when she won for best supporting actress for "Fences": She praised the art.
"I became an artist and thank God I did because we are the only profession that celebrates what it means to live a life," Davis said.
Even people who weren't actually in attendance delivered memorable speeches. The best foreign language film award for Iran's "The Salesman" was accepted by Anousheh Ansari, who read a speech prepared by director Asghar Farhadi.
Farhadi opted not to attend in protest over President Trump's travel ban made it unclear whether he would even be allowed into the country to attend.
"Dividing the world into the 'us and our enemies' categories creates fear, a deceitful justification for aggression and war," he wrote in his speech. "These wars prevent democracy and human rights in countries which have themselves been victims of aggression."
Such political themes touched the night from the beginning, with Kimmel's opening monologue. Among other things, during that monologue Kimmel led a round of applause for the "highly over-rated" actress Meryl Streep.
Streep had been hailed this year for her Golden Globes acceptance speech in which she denounced Trump's campaign rhetoric without ever mentioning his name. Trump slammed her as "one of the most over-rated actresses in Hollywood" in a tweet afterwards.
In the opening monologue, which followed a musical performance by Justin Timberlake, Kimmel also gave a little ribbing to the show, and to himself, joking, "This is my first time here and the way you people go through hosts it's probably my last time."
The host also provided some levity later on in the broadcast in a bit which involved a group of unsuspecting tourists finding themselves suddenly a part of the show.
Upon finding out that one couple was engaged, Kimmel enlisted nominee Denzel Washington to "marry" them on the spot.