Brian Truitt

USA TODAY

It was like M. Night Shyamalan directing the Oscars.

Two minutes after Hollywood musical La La Land was named best picture at Sunday's 89th Academy Awards, there was a twist ending: Presenters Faye Dunaway and Warren Beatty somehow got Emma Stone's best actress card instead of the right one, and it was in fact the arthouse darling Moonlight that won the night's big prize.

"There was a time when I thought this movie was impossible because I couldn't bring it to fruition," Moonlight director Barry Jenkins said when accepting the best picture Oscar. "I couldn't bring myself to tell another story, so everybody behind me on this stage said, 'No, that is not acceptable.' "

In the ceremony hosted by Jimmy Kimmel, Moonlight picked up three awards total — including adapted screenplay and supporting actor for Mahershala Ali — but La La Land's tally wasn't too shabby: It won six Oscars, including best director for Damien Chazelle — the youngest person to ever win the honor — and best actress for Emma Stone. Fences star Viola Davis and Casey Affleck of Manchester by the Sea also picked up their first Oscar wins, for supporting actress and best actor respectively.

Oscars 2017: Winners' list

Here's a minute-by-minute (ET) breakdown of the festivities:

12:09: And the musical has it: La La Land is named best picture, its seventh Oscar of the night. Or not! Faye Dunaway read the wrong movie and Moonlight is actually best picture. "Very clearly even in my dreams, this couldn't be true. But hell with it! It is true!" says director Barry Jenkins, taking the weirdness so well. "We didn't do this. You chose us. Thank you for the choice."

11:57: La La Land wins its sixth Oscar and Emma Stone grabs her first one ever for best actress. "To the women in this category ... you are all so extraordinary and I look up to you and I admire you," says an out-of-breath Stone. "I still have a lot of growing and learning and work to do, and this guy is a really beautiful symbol to continue on that journey."

11:51: Casey Affleck wins his first Oscar and takes best actor for Manchester by the Sea. "It means so much to me," says an emotional Affleck. "Without this part and without (Kenneth Lonergan's) writing, I wouldn't be here." Tearing up in the audience: His brother Ben.

11:42: At 32, La La Land filmmaker Damien Chazelle becomes the youngest person to ever win best director. "This is a movie about love and I fell in love making it," says Chazelle when thanking his girlfriend Olivia Hamilton.

Review: Kimmel comes out comfortable and swinging in debut as Oscars host

11:34: Moonlight wins best adapted screenplay, and Barry Jenkins thanks pretty much everyone he knows: "I really wanted this result because there is a bajillion people watching."

11:30: Ben Affleck arrives to present best original screenplay with Matt Damon, and Kimmel hilariously tries to play off his forever foe Damon. Seriousness returns and Kenneth Lonergan wins the Oscar for Manchester by the Sea. "I love movies, I love being part of the movies," says Lonergan, thanking Casey Affleck three times and saying farewall to his father, who died last year.

11:21: Sara Bareilles sings Joni Mitchell's Both Sides Now for the "In Memoriam" segment, which didn't include this weekend's passing of Bill Paxton.

11:15: Composer Justin Hurwitz wins his first Oscar for La La Land's original score and quickly follows it up with his second, best original song for City of Stars. "This is dedicated to all the kids who sing in the rain and all the moms who let them," says lyricist Benj Pasek.

11:05: John Legend takes the stage to sing La La Land's Oscar-nominated original tunes, City of Stars and Audition — neither of which is the actual song he did perform in the movie.

10:59:La La Land's starting to pick up a little steam here, with Linus Sandgren winning for best cinematography and calling his director Damien Chazelle "a poetic genius."

10:50: Kimmel's worried about the fact that President Trump hasn't tweeted during the Oscars yet. He sends POTUS two tweets, one asking if he's still up and the other with the hashtag #Merylsayshi.

10:45:The White Helmets, about volunteer rescue workers in the Syrian Civil Defense, nabs best documentary short subject, while live-action short goes to Sing, which follows friends in a Budapest elementary school choir.

10:39: Kimmel re-enacts the baby-lifting scene from The Lion King with Sunny Pawar of Lion. It's adorable, of course.

10:33: Seth Rogen takes the stage with Michael J. Fox, the Back to the Future DeLorean and futuristic kicks. They present the Oscar for film editing, which goes to Hacksaw Ridge — now two wins total for Mel Gibson's war movie.

10:31:The Jungle Book bests the movie magic of Rogue One and Doctor Strange for the visual effects Oscar.

10:18: Kimmel brings in random people from a tour bus. "On the count of three, we'll turn the lights on and everybody yell 'Mahershala'!" Kimmel says. One man is documenting the event via smartphone, and the host tells him, "We're on TV so you don't have to do that." The guy's response: "I want to." Denzel Washington also "marries" a couple of them. "It's Denzel so it's legal," Kimmel retorts. A lady is awarded Jennifer Aniston's sunglasses, and everybody gets to rub Mahershala Ali's new Oscar.

10:15: La La Land gets its first Oscar of the night, snagging the honor for best production design.

'Moonlight' writers: 'This goes out to all those black and brown boys'

10:08: Pixar's Piper takes best animated short while fellow Disney project Zootopia wins for animated feature. "We are so grateful to the audiences all over the word that embraced this film with this story of tolerance being more powerful than fear of the other," says Zootopia director Rich Moore.

10:02: Sting performs his Oscar-nominated song The Empty Chair from Jim: The James Foley Story. He performs in front of a picture of the late journalist Foley and the words "If I don't have the moral courage to challenge authority ... we don't have journalism."

9:58:The Salesman wins for best foreign-language film. "It's a great honor to be receiving this valuable award for the second time," says Iranian director Asghar Farhadi in a statement after boycotting the Oscars because of the recent travel ban. "Dividing the world into the 'us' and 'our enemies' categories creates fear. It's a deceitful justification for aggression and war. These wars prevent democracy and human rights in countries which have themselves been victims of aggression. Filmmakers can turn their cameras to capture shared human qualities and break stereotypes of various nationalities and religions. They create empathy between us and others, an empathy we need today more than ever."

Viola Davis's explosive Oscars speech was an instant classic

9:44: In her third try, Viola Davis finally gets her first Oscar, for supporting actress for Fences. "I became an artist and thank God I did because we are the only profession that celebrates what it means to live a life," says Davis, also celebrating writer August Wilson "who exhumed and exalted the ordinary people." And to her director Denzel Washington, she adds, "Thank you for putting two entities in the driver's seat — August and God — and they served you well."

9:28: Arrival picks up its first Oscar of the night — best sound editing — and Hacksaw Ridge takes best sound mixing. And with La La Land losing both those categories, it won't be able to break or tie the all-time mark for Oscar wins.

9:26: Red Vines and Junior Mints are parachuted down from the rafters, followed by a Kimmel Spanx crack.

9:15: Dwayne Johnson introduces his "twin" Lin-Manuel Miranda and Hollywood newcomer Auli'i Cravalho to perform best song contender How Far I'll Go from Moana. Miranda raps a new prologue before giving way to Cravalho belting the tune.

9:09: Hidden Figures stars Taraji P. Henson, Janelle Monae and Octavia Spencer introduce Katherine Johnson on stage, followed by a standing ovation for the former NASA mathematician and subject of the movie. "Thanks very much," she says. The actresses then present the Oscar for best documentary feature, which goes to O.J.: Made in America. "This is incredible," says director Ezra Edelman, who thanks the Academy for honoring "this nontraditional film" and pays tribute to not only the families of Nicole Brown Simpson and Ronald Goldman but also victims of "criminal injustice."

9:01: Colleen Atwood gets her fourth career Oscar for costume design, taking the award for Fantastic Beasts and Where to Find Them. In other news, it's La La Land's first loss of the night, though it can still break the record of 11 total Oscar wins.

8:58: Sorry, haters: That's OSCAR-WINNING Suicide Squad, which takes the honor for best makeup and hairstyling.

8:49: Mahershala Ali wins the first big trophy of the night, best supporting actor for Moonlight. "My grandma would want me to button up," he says, adjusting his suit and thanking his teachers. "It’s not about you, it’s about these characters. You’re a service to these stories and these characters and I was so blessed to have this opportunity." Also pays tribute to his wife, who just had their daughter four days ago.

8:35: Host Jimmy Kimmel finally takes the stage "to a sitting ovation" and knocks over a mic stand. Kimmel jokes to Timberlake that there's a good chance the rest of 'N Sync will let him back in the band. He gets the first political poke in with a joke about the Oscar-cast going to "countries that now hate us" and another jab at Mel Gibson: "There's only one Braveheart in the room and he's not going to unite us." Naturally Kimmel takes shots at his usual foil Matt Damon ("I've known Matt so long, when I first Matt, I was the fat one") and points out that he gave Casey Affleck his Manchester by the Sea role to "Chinese pony-tailed movie. And that movie The Great Wall went on to lose $80 million." Other topics: Damien Chazelle's youth, Amazon's Jeff Bezos and the sadness of Manchester, how no one watched Moonlight, best actress nominee Isabelle Huppert ("We didn't see Elle but we absolutely loved it"), and the "overrated performances" of Meryl Streep. "She has phoned it in for 50 films in her lackluster career."

8:30: Justin Timberlake opens the show by arriving from the back of the hall and singing his Oscar-nominated hit single from Trolls, Can't Stop the Feeling! He's got the whole crowd on its feet, taking time to say hey to Ryan Gosling. Seb from La La Land would probably not totally love this, however Taraji P. Henson is singing along and feeling it. Timberlake segues into a short bridge of Lovely Day before returning once more to Feeling.