Moonlight has won best picture at the Oscars - but only after Faye Dunaway initially said La La Land had won.
Warren Beatty was handed the previous winner's envelope, containing a card saying "Emma Stone, La La Land", resulting in the error.
The team from La La Land was in the middle of its acceptance speeches when the mistake was discovered.
Stone said backstage afterwards: "Is that the craziest Oscar moment of all time? Cool! It's going to be history."
PriceWaterhouseCooper, the accountancy firm responsible for counting the ballots, said in a statement: "We sincerely apologise to Moonlight, La La Land, Warren Beatty, Faye Dunaway, and Oscar viewers for the error that was made during the award announcement for best picture.
"The presenters had mistakenly been given the wrong category envelope and when discovered, was immediately corrected. We are currently investigating how this could have happened, and deeply regret that this occurred."
Musical La La Land won six Oscars including best director and best actress. Moonlight also won adapted screenplay and best supporting actor.
Damien Chazelle, director of La La Land, became the youngest filmmaker to win a best director Oscar at the age of 32.
Beatty's Bonnie and Clyde co-star Faye Dunaway announced La La Land had taken the best picture prize - but then the musical's producer Jordan Horowitz announced there had been a mistake.
He said: "This is not a joke. Moonlight is best picture," and showed the camera the card that revealed the winner.