An accountant for the Academy Awards botched the meticulous procedure for announcing the Oscar for Best Picture when he handed victory to La La Land before declaring Moonlight the real winner, PricewaterhouseCoopers (PwC) said on Monday.

Accountant Brian Cullinan, who media reports said had been tweeting backstage shortly before, gave presenters Warren Beatty and Faye Dunaway the wrong envelope for the movie industry's top award on Sunday, the accounting firm said in a statement.

In a gaffe that stunned the Dolby Theatre crowd in Hollywood and a television audience worldwide, “Cullinan mistakenly handed the back-up envelope for Actress in a Leading Role instead of the envelope for Best Picture” to Beatty and Dunaway, PwC said.

“Once the error occurred, protocols for correcting it were not followed through quickly enough by Mr. Cullinan or his partner.”

The Wall Street Journal and celebrity website TMZ.com reported that Cullinan had posted a backstage photo of actress Emma Stone on social network Twitter minutes before the mix-up.

The photo, from Cullinan's Twitter account, was later deleted but was still viewable on Monday on a cached archive of the page. Cullinan could not immediately be reached for comment.

The mistake was not rectified until the La La Land cast and producers were on stage giving their acceptance speeches. It was left to the musical's producer, Jordan Horowitz, to put things right.

“Guys, guys, I'm sorry. No. There's a mistake,” Horowitz said. “Moonlight, you guys won best picture. This is not a joke.”

It took three hours for PricewaterhouseCoopers, which has been overseeing Academy Awards balloting for 83 years, initially to confirm that Beatty and Dunaway received the wrong category envelope.

Stars on the front row react to the gaffe during the Oscars ceremony (AP)

PwC said it took full responsibility and apologised to the casts and crews of La La Land and Moonlight.

“We sincerely apologise to Warren Beatty, Faye Dunaway, (host) Jimmy Kimmel, (broadcaster) ABC, and the Academy, none of whom was at fault for last night's errors,” it said in its statement.

The Academy of Motion Picture Arts and Sciences, which organises the Oscars, also apologised for the mishap and said it was committed to upholding the integrity of the Oscars.

“We have spent last night and today investigating the circumstances, and will determine what actions are appropriate going forward,” it said in a statement.

An embarrassed Beatty carried the envelope to the glitzy Governor's Ball after the show, with the writing clearly saying “actress in a leading role.” “La La Land star Stone had been awarded that Oscar moments before.

“Except for the end, it was fun,” Kimmel said on Monday, referring to the Oscar show he hosted.

“You know it's a strange night when the word 'envelope' is trending on Twitter,” he said on his ABC show Jimmy Kimmel Live.”

Brand management experts said it could take years for PricewaterhouseCoopers to recover.

“This is not advanced math. PwC had to get the right name in the right envelope and get it to the right person,” said Tim Calkins, a marketing professor at Northwestern University, calling the blunder a “bit of a branding tragedy.”

Under a PwC procedure, just two accountants know the names of the 24 winners after their names are placed in two sets of sealed envelopes. The two accountants also memorise the winning names.

Confusion reigns at the Oscars (Mark Ralston/AFP/Getty)

Tradition has it that the envelopes are taken separately in two briefcases to the Academy Awards venue. The two accountants - in this case Cullinan and Martha Ruiz - are driven there separately, in case of an accident or traffic delays.

The pair then stand off stage at opposite sides and hand envelopes to the respective presenters as each category is announced.

Last week, Cullinan told the Huffington Post the procedure for dealing with the hand-off of an incorrect envelope, other than signalling to a stage manager, was unclear.

“It's so unlikely,” Cullinan added.

The error was corrected quickly, although precious minutes passed, said Anthony Sabino, a law professor at St John's University in New York.

“It's not as if we woke up this morning, or if it had been uncovered after the telecast was over. That would have really have been a black eye,” he added.

Oscars 2017: Best dressed on the red carpet Show all 25 1 /25 Oscars 2017: Best dressed on the red carpet Oscars 2017: Best dressed on the red carpet Hailee Steinfeld Getty Images Oscars 2017: Best dressed on the red carpet Taraji P. Henson Getty Images Oscars 2017: Best dressed on the red carpet Chrissy Teigen Getty Images Oscars 2017: Best dressed on the red carpet Ruth Negga Reuters Oscars 2017: Best dressed on the red carpet Dev Patel PA Oscars 2017: Best dressed on the red carpet Karlie Kloss Getty Images Oscars 2017: Best dressed on the red carpet Emma Roberts Getty Images Oscars 2017: Best dressed on the red carpet Riz Ahmed Oscars 2017: Best dressed on the red carpet Felicity Jones AFP/Getty Images Oscars 2017: Best dressed on the red carpet Isabelle Huppert AFP/Getty Images Oscars 2017: Best dressed on the red carpet Octavia Spencer Oscars 2017: Best dressed on the red carpet Mahershala Ali Rex Features Oscars 2017: Best dressed on the red carpet Michelle Williams Getty Images Oscars 2017: Best dressed on the red carpet Naomie Harris AFP/Getty Images Oscars 2017: Best dressed on the red carpet Scarlett Johansson Getty Images Oscars 2017: Best dressed on the red carpet Ryan Gosling Getty Images Oscars 2017: Best dressed on the red carpet Viola Davis Getty Images Oscars 2017: Best dressed on the red carpet Charlize Theron Getty Images Oscars 2017: Best dressed on the red carpet Dakota Johnson REUTERS Oscars 2017: Best dressed on the red carpet Chris Evans Oscars 2017: Best dressed on the red carpet Brie Larson Oscars 2017: Best dressed on the red carpet Jamie Dornan and Amelia Warner REUTERS Oscars 2017: Best dressed on the red carpet Sofia Boutella PA Oscars 2017: Best dressed on the red carpet Pharrell Williams Rex Features Oscars 2017: Best dressed on the red carpet Kirsten Dunst Getty Images

Compared to accounting fraud at other companies in the past, “this incident diminished vastly to a vanishing point,” Sabino said.

The Moonlight filmmakers were gracious about the error.

Director Barry Jenkins told reporters backstage that he received no immediate explanation for the mix-up, though “it made a very special feeling even more special, but not in the way I expected.”

Jenkins added, “Please write this down: The folks from La La Land were so gracious.”