LOS ANGELES — It was one of the most awkward moments in the history of the Oscars, of television, in entertainment, heck maybe in American history.

And somehow Warren Beatty, Hollywood’s ultimate smooth leading man, was at the centre of it.

The producers of “La La Land” were nearly done with their acceptance speeches for Best Picture, the Oscar broadcast’s credits sequence about to roll, when a stir of whispers began on stage. Moments later “La La Land” producer Jordan Horowitz returned to the microphone and said “Moonlight won Best Picture” and insisting that “this is not a joke.”

The collective jaw of the crowd at the Dolby Theatre — and of America — remained dropped long after they became convinced it was no joke, but what academy historians later called an apparently unprecedented Oscar error.

Beatty returned to the mic and amid silence, explained that he had opened the envelope and he was confused when it read “Emma Stone, La La Land.” He had shown it to co-presenter Faye Dunaway briefly, as though he wanted her to read it, which she did, apparently assuming the Emma Stone part was off but the “La La” part correct.

“It’s one of the strangest things that’s ever happened to me,” Beatty said backstage. “Thank God there were two of us up there,” Dunaway responded.

The actress then asked Beatty, “Who else should I tell?”

“Everybody,” he said.

At that point, a security guard tried to take the real envelope and Beatty said, “Security is not getting this. I’m giving it to (Moonlight director) Barry Jenkins at a later time.” Beatty also refused to show it to anyone else.

ABC News, tweeting about the ceremony broadcast on its network, said the envelope held by Beatty read, “Actress in a leading role.” A close-up photo of Beatty onstage verified that.

The mistake was being investigated by the academy, which had no immediate comment Sunday.

PwC, formerly known as Price Waterhouse Coopers, is the accounting firm that counts votes and provides winner envelopes for the Oscars and has done so for more than 80 years.

When the firm’s representatives realized the mistake, they raced onstage to right it, but too late, officials told The Associated Press.

The result was a bizarre scene with the entire cast of both movies standing together on stage exchanging sympathetic awkward stares and hugs.

The crowd had to rouse itself from its stunned stupor to try to give “Moonlight” its just due for winning the big award. And as the credits rolled, usually bringing sweet relief after a long night, people appeared hesitant to leave in their disbelief.

“It made a very special feeling even more special, but not in the way I expected,” a bemused Jenkins, co-writer and director of “Moonlight,” said backstage.

“The folks at ‘La La Land’ were so gracious,” he added. “I can’t imagine being in their position and having to do that.”

Filmmaker Kenneth Lonergan, who won a best screenplay award for “Manchester by the Sea,” cracked wise backstage: “It turns out that we actually won best picture, which we’re really happy about,” he said.

The ceremony’s chaotic scene immediately raced to the top of all-time Oscar moments, far more stunning than the nude man who raced across the stage in 1974 as part of the “streaking” fad.

And it immediately evoked Steve Harvey’s recent gaffe of naming the wrong Miss Universe winner.

The Miss Universe Twitter account quickly let the Oscars know they felt their pain.

“Have your people call our people, we know what to do,” the tweet read.

That was the beginning of a Tweet pile-on that may be the biggest of all time, with many declaring that “La La Land” won the popular vote while “Moonlight” won the electoral college.

But this stage, and this audience, were far, far bigger and are likely to last far, far longer in collective memory.

___

AP writers Lynn Elber, Beth Harris and Lindsey Bahr contributed to this report.

Sandy Cohen And Andrew Dalton, The Associated Press