There was confusion and controversy at the Oscars as Moonlight won the best picture prize after La La Land was mistakenly announced as the winner.

The producers of the musical were already concluding their speeches when it was revealed there had been a mix-up and Moonlight had in fact scored the top prize of the night.

Bonnie and Clyde stars Warren Beatty and Faye Dunaway had announced La La Land had taken the best picture prize and the cast and crew had flooded the stage before producer Jordan Horowitz said: " There's a mistake. Moonlight, you guys won best picture.

"This is no joke. I'm afraid they read the wrong thing. This is not a joke, Moonlight, you won best picture."

Prior to learning of a presentation error, 'La La Land' producers Jordan Horowitz (speaking at microphone), Fred Berger and Marc Platt accept the Best Picture award for 'La La Land'

Beatty returned to the microphone to say: "I want to tell you what happened I opened the envelope and it said Emma Stone, La La Land and that is why I took such a long look at Faye and at you.

"I wasn't trying to be funny. This is Moonlight for best picture."

Backstage, Stone said she had been holding her winners card in her hand at the time the best picture winner was announced.

The film's director Barry Jenkins said: "Very clearly even in my dreams this can't be true. But to hell with dreams because this is true. It's true, it's not fake."

La La Land, which had scored a record-tying 14 nominations, ended up with just six wins, including best actress for Emma Stone and best director for Damien Chazelle, who is the youngest winner of the prize at 32.

'La La Land' producer Jordan Horowitz (C) stops the show to announce the actual Best Picture winner as 'Moonlight' following a presentation error

Moonlight, which follows the life of a young black boy dealing with his sexuality, scooped three prizes in total, landing best picture, best adapted screenplay and best supporting actor for Mahershala Ali.

The film's producer Dede Gardner said: "I'm still not sure this is real. It's very humbling to be up here and I hope it's inspiring to little black boys and brown girls who feel marginalised. I hope they take some inspiration from seeing this beautiful group of artists."

Host Jimmy Kimmel joked that he knew he would mess up compering the ceremony.

He added: "Personally I blame Steve Harvey for this," referring to Harvey's mistake in announcing the Miss Universe winner in 2015.

Stone, 28, who has already received a Golden Globe and Bafta for her role in the hit musical thanked Chazelle and Ryan Gosling, saying of her co-star: "Thank you for making me laugh and for always raising the bar and for being the best partner in this crazy adventure."

Ali won the first Oscar of the 89th Academy Awards when he scooped the best supporting actor prize.

Producer Adele Romanski (C), writer/director Barry Jenkins, producer Jeremy Kleiner and cast/crew members accept Best Picture for 'Moonlight'

He welcomed his first child Bari Najma on February 22 and thanked his wife Amatus Sami-Karim saying: "My wife was in her third trimester doing awards seasons, we just had a daughter four days ago. I just want to thank her for being such a soldier through this process."

Viola Davis received a standing ovation and cheers as she won the best supporting actress Oscar for her role in Fences.

Davis, who has been nominated twice before for Doubt and The Help, had been the front runner for the prize all through awards season. She paid tribute to her co-star and director Denzel Washington, saying: "Oh captain, my captain, Denzel Washington, thank you for putting two entities in the driving seat, August Wilson and God and they served me well."

Casey Affleck won the best actor in a leading role Oscar for his role in Manchester By The Sea, beating fellow actors Ryan Gosling, Denzel Washington, Andrew Garfield and Viggo Mortensen.

Affleck, 41, was hugged and kissed by his brother, Batman star Ben Affleck as his name was called and received a standing ovation as he made his way to the stage.

The actor was tearful as he made his acceptance speech, saying: "This means so much to me, thank you. One of the first people who taught me how to act was Denzel Washington and I just met him tonight for the first time."

Affleck ended his speech by thanking his parents for "mostly believing in me" and added: "Ben, I love you, you ain't heavy."

Closeup detail shot of Oscar statuettes as 'La La Land' producer Jordan Horowitz (L) accepts Best Picture after a presentation error

Many had expected the ceremony to be dominated by political speeches but references to President Donald Trump were mainly limited to jibes from Kimmel, who kicked off the ceremony by thanking the president for making the Oscars appear less racist.

He added: "I want to say thank you to President Trump. Remember last year when it seemed like the Oscars were racist? It's gone!"

The Salesman, directed by Iranian film-maker Asghar Farhadi, who is boycotting the ceremony because of Donald Trump's travel ban, has won the foreign language film Oscar.

In a statement read on his behalf, Farhadi, whose film A Separation won the same prize in 2012, said it was a "great honour" to receive the prize for a second time.

He added: "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 nations whom have been disrespected by the inhumane law that bans entry of immigrants to the US.

"Dividing the world into the us and our enemies categories creates fear. A deceitful justification for aggression and war. These wars prevent democracy and human rights in countries which have themselves been victims of aggression."

Video Loading

During a break in awards, Kimmel said he was worried about President Trump because he had not yet tweeted anything about the ceremony.

He wrote on his Twitter account: "Hey @realDonaldTrump u up?" and followed it up with "@realDonaldTrump #Merylsayshi".

The President has not yet commented on the ceremony.

Moonlight beat La La Land to claim the coveted best picture Oscar, following a mix-up which saw Damien Chazelle's musical erroneously announced as the winner.

Here is a list of winners:

Best Picture:

Moonlight

Actor in a Leading Role:

Casey Affleck - Manchester By The Sea

Actress in a Leading Role:

Emma Stone - La La Land

Actor in a Supporting Role:

Mahershala Ali - Moonlight

Actress in a Supporting Role:

Viola Davis - Fences

Directing:

Damien Chazelle - La La Land

Adapted Screenplay:

Moonlight - Barry Jenkins

Writing (Original Screenplay):

Manchester By The Sea - Kenneth Lonergan

Animated Feature Film:

Zootopia

Cinematography:

La La Land - Linus Sandgren

Music (Original Song):

City Of Stars - La La Land

Music (Original Score):

La La Land