Director Alejandro Gonzalez Inarritu joked that his good luck charm for the night was "Michael Keaton's tighty-whities."
"They are tight, smells like balls, but it worked. I'm here; thank you Michael," he said.
The surreal comedy about an actor fleeing his superhero past also won best original screenplay and best cinematography.
Eddie Redmayne won the best actor prize for his portrayal of Stephen Hawking in "The Theory of Everything," while Julianne Moore was named best actress for her heartbreaking performance in "Still Alice," which shined a light on Alzheimer's disease.
"So many people with this disease feel isolated and marginalized, and one of the wonderful things about movies is it makes us feel seen and not alone, and people with Alzheimer's deserve to be seen so that we can find a cure," Moore said.
Host Neil Patrick Harris kicked off the 87th Oscars with a tribute to memorable film moments, and Anna Kendrick and Jack Black joined him on stage to pay a hilarious homage to Hollywood history.
The first award of the night went to J.K. Simmons for best supporting actor for his role as a jazz instructor in "Whiplash." He accepted his award thanking his wife and "above-average children."
"Joe and Olivia, you are extraordinary human beings, smart, funny, kind, loving people, and that's because you are a reflection of your mother," Simmons said.
The best supporting actress award went to Patricia Arquette, who used her speech to make a passionate stand for women's rights.
"It's our time to have wage equality once and for all, and equal rights for women in the United States of America," she said, as cheers erupted in Dolby Theatre.
The most powerful moment of the night came when John Legend and Common performed "Glory" from the movie "Selma." The stirring and soulful rendition brought the crowd to their feet, and cameras caught David Oyelowo and Chris Pine with tears streaming down their face.
Moments later, John Legend and Common won the Oscar for best original song.
"We wrote this song for a film that was based on events that were 50 years ago, but we say that Selma is now because the struggle for justice is right now," Legend said in his acceptance speech.
When accepting the best adapted screenplay award for "Imitation Game," Graham Moore dedicated his win to any youngsters who felt they were different and don't fit in.
He revealed that he tried to kill himself when he was 16 years old and urged them to "stay weird, stay different, and then when it's your turn, and you are standing on this stage, please pass the same message to the next person who comes along."
Disney's "Big Hero 6" pulled off something of an upset in the best animated feature category, besting DreamWorks' favored "How to Train Your Dragon 2."
The Associated Press contributed to this report.