'Moonlight' wins best picture after 'La La Land' mistakenly announced "I wasn't trying to be funny," presenter Warren Beatty said.

 -- The climax of Hollywood's biggest night ended in what will surely be a long-remembered snafu, as the initial announcement that the best picture award went to "La La Land" had to be retracted and corrected to the real winner, "Moonlight."

The announcement of "La La Land" as best picture was followed by several moments of apparent chaos onstage that ended with Jordan Horowitz, a producer of "La La Land," announcing that it was not really his picture that won.

"There's a mistake. 'Moonlight,' you guys won best picture ... This is not a joke," Horowitz said.

A clearly startled audience stood and erupted in applause for "Moonlight." Director Barry Jenkins, the cast and other crew members then dashed onstage to accept the prize.

"Even in my dreams, this could not be true. But to hell with dreams," Jenkins said.

As it turns out, the presenters for the award, Faye Dunaway and Warren Beatty, were given the wrong envelope before they walked onto the stage. An enlarged video still of him at the mic shows him holding an envelope that reads "Actress in a leading role."

PricewaterhouseCoopers, the accounting firm that tallies the Oscars votes, said it is investigating how the mishap occurred.

"We sincerely apologize 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 company said in a statement. "We appreciate the grace with which the nominees, the academy, ABC and [host] Jimmy Kimmel handled the situation."

Host Jimmy Kimmel joked and said, "I blame Steve Harvey," alluding to his gaffe announcing the wrong Miss Universe winner in 2015.

Beatty, who has been nominated for 14 Academy Awards, said after the real winner was announced, "I wasn't trying to be funny."

Jenkins, accepting the award, made sure to give the movie that was incorrectly announced its due.

"I love 'La La Land,'" he said. "Thank you to the academy. It is so humbling to be standing up there ... There was a time that I thought this movie was impossible because I couldn't bring it to fruition ... Everybody behind me on this stage said, 'No, that's not acceptable,' so I just want to thank everyone behind me.'"