Image copyright Reuters Image caption Jimmy Kimmel laughs with Warren Beatty as Moonlight and La La Land's Barry Jenkins and Jordan Horowitz embrace over the mistake

Here is a selection of highlights from some of the winners' speeches:

La La Land, and then Moonlight: Best film

Fred Berger, La La Land producer: "We lost by the way, but you know."

Jordan Horowitz, La La Land producer: "Guys, I'm sorry, no, there's a mistake. Moonlight, you guys won best picture."

Marc Platt, La La Land producer: "This is not a joke, I'm afraid they read the wrong thing."

Image copyright Getty Images Image caption La La Land's Jordan Horowitz [centre] announced the actual Best Picture winner as Moonlight

Jordan Horowitz: "This is not a joke, Moonlight has won best picture. [Reads] Moonlight, best picture."

[Someone off camera, possibly Warren Beatty]: "I think you should keep it anyway."

Host Jimmy Kimmel: "Guys, this is very unfortunate what happened. Personally I blame Steve Harvey for this [referring to Harvey's mistake in announcing the Miss Universe winner in 2015.].

[To Jordan Horowitz]"I would like to see you get an Oscar anyway, why can't we just give out a whole bunch of them?"

Jordan Horowitz: "I'm going to be really proud to hand this to my friends from Moonlight."

Jimmy Kimmel: "That's really nice of you thanks very much."

Warren Beatty: "Hello. I want…"

Jimmy Kimmel: "Warren what did you do?!"

Warren Beatty: "I want to tell you what happened. I opened the envelope, and it said Emma Stone, La La Land. That's why I took such a long look at Faye, and at you [the audience], I wasn't trying to be funny. "

Jimmy Kimmel: "Well you were funny, that was very funny."

Image copyright Getty Images Image caption Barry Jenkins said "it's not fake" when he won best film

Warren Beatty: "Thank you very much. This is Moonlight, the best picture."

Barry Jenkins, Moonlight director and writer: "Very clearly, even in my dreams this could not be true, but to hell with dreams, I'm done with it because this is true, oh my goodness.

"And I have to say, and it is true it's not fake, we've been on the road with these guys for so long and that was so gracious, so generous of them, my love to La La Land, my love to everybody, man."

Viola Davis: Best supporting actress for Fences

Image copyright AFP/Getty

"Thank you to the Academy. You know, there's one place that all the people with the greatest potential are gathered. One place. And that's the graveyard.

"People ask me all the time: 'What kind of stories do you want to tell, Viola?' And I say, exhume those bodies. Exhume those stories.

"The stories of the people who dreamed big and never saw those dreams to fruition. People who fell in love and lost.

"I became an artist, and thank God I did, because we are the only profession that celebrates what it means to live a life. So here's to August Wilson, who exhumed and exalted the ordinary people.

"And, O captain, my captain, Denzel Washington. Thank you for putting two entities in the driving seat: August and God. And they served you well.

"And to Dan and Mae Alice Davis, who were - and are the centre of my universe. The people who taught me good or bad, how to fail, how to love, how to hold an award, how to lose: my parents.

"I'm so thankful that God chose you to bring me into this world. To my sisters. My sister Deloris, who's here, who played Jaji and Jaja with me. We were rich white women in the tea party games.

"Thank you for the imagination. And to my husband and my daughter, my heart, you and Genesis. You teach me every day how to live, how to love. I'm so glad that you are the foundation of my life. Thank you to the Academy. Thank you."

Mahershala Ali: Best supporting actor for Moonlight

Image copyright Reuters

"I want to thank my teachers and professors, I had so many wonderful teachers, and one thing they consistently told me was that it's not about you, it's about these characters. You're a servant, you're in service to these stories and these characters.

"I'm so blessed to have had an opportunity. It was such a wonderful experience, thank you [director] Barry Jenkins, thank you Tarell Alvin McCraney [writer of the play Moonlight was based on].

"I also want to thank my wife, we just had our daughter four days ago, so I just want to thank her for being such a soldier through this process and really carrying me through it all. Thank you, peace and blessings."

Emma Stone: Best actress for La La Land

Image copyright AP

"To the women in this category - you were all so extraordinary and I look up to you and admire you. It has been the greatest honour to stand alongside you.

"I realise a moment like this is a huge confluence of luck and opportunity so I want to thank Damien Chazelle to be given the opportunity. Ryan Gosling, thank you for making me laugh and always raising the bar and being the best partner on this crazy adventure.

"To all the people that worked on this movie, I'm going to find you all individually and I'm going to thank you. I'm going to hug the hell out of you when the feeling re-enters my body. I still have a lot of growing and learning to do, and this guy (the Oscar statue) is a really beautiful symbol of continuing to do that."

Casey Affleck: Best actor for Manchester by the Sea

Image copyright AP

"One of the first people who taught me how to act was Denzel Washington and I met him tonight for the first time, thank you.

"I'm only here because of all the talent and goodwill of so many people. Most of all [director and writer] Kenneth Lonergan, without his writing I wouldn't be here for sure. I'm really proud to be a part of this community and I'm dumfounded that I'm included.

"Thank you to [producer] Matt Damon for creating this opportunity [he was going to star in the film and handed the role to Affleck] and to my mother and my father for mostly, usually believing in me and doing this. Ben [his brother] I love you, you ain't heavy, I appreciate it.

Asghar Farhadi: Best foreign language film for The Salesman

Image copyright AFP/Getty Image caption Anousheh Ansari (L) appeared with ex-Nasa scientist Firouz Naderi and actresses Shirley MacLaine and Charlize Theron

The Iranian director's speech was read out on his behalf by the world's first female space tourist, Anousheh Ansari.

She referenced President Trump's recent ban of immigrants travelling to the US from seven countries, including Iran.

"It's a great honour to be receiving this valuable award for the second time.

"I'm sorry I'm not with you tonight, my absence is out of respect for the people of my country and those of the other six countries who have been disrespected by the inhumane law that bans immigrants from seven countries to the US."

Orlando von Einsiedel and Joanna Natasegara: Best documentary short subject for White Helmets

Image copyright AFP/Getty

Joanna Natasegara: "Thanks to the Academy for this huge honour. To all of our teams. Of course to Netflix, our work family, for supporting us with this film but most of all, thank you to the White Helmets.

Orlando von Einsiedel: "Sadly, Raed Saleh, the head of the White Helmets, is not able to join us tonight. We have a very short statement from him that we'd like to share with you: 'We're so grateful that this film has highlighted our work to the world. Our organisation is guided by a verse from the Koran: 'To save one life is to save all of humanity.'

"We have saved more than 82,000 civilian lives. I invite anyone here who hears me to work on the side of life, to stop the bloodshed in Syria and around the world.

"It's very easy for these guys to feel they're forgotten. This war's been going on for six years. If everyone could just stand up and remind them that we all care, that this war end as quickly as possible. Thank you."

Follow our Oscars board on Pinterest or join the conversation on Facebook, on Twitter @BBCNewsEnts, or on Instagram at bbcnewsents. If you have a story suggestion email entertainment.news@bbc.co.uk.