‘‘The story was so top secret that the film’s director is unknown to the academy,’’ MacFarlane said. ‘‘They know they screwed up. Ben, it’s not your fault.’’
‘‘Argo’’ also claimed the Oscar for adapted screenplay for Chris Terrio, who worked with Affleck to create a liberally embellished story based on an article about the rescue and part of CIA operative Tony Mendez’s memoir.
Terrio dedicated the award to Mendez, saying ‘‘33 years ago, Tony, using nothing but his creativity and his intelligence, Tony got six people out of a bad situation.’’
The foreign-language prize went to Austrian filmmaker Michael Haneke’s old-age love story ‘‘Amour,’’ which had been a major surprise with five nominations, including picture, director and original screenplay for Haneke and best actress for Emmanuelle Riva, who turned 86 on Sunday and would be the oldest acting winner ever.
The top prize winner at last year’s Cannes Film Festival, ‘‘Amour’’ follows the agonizing story of an elderly man (Jean-Louis Trintignant) tending his wife (Riva) as she declines from age and illness.
Haneke thanked his own wife for supporting him in his work for 30 years.
‘‘You are the center of my life,’’ Haneke said.
The Scottish adventure ‘‘Brave,’’ from Disney’s Pixar Animation unit, was named best animated feature. Pixar films have won seven of the 12 Oscars since the category was added.
‘‘I just happen to be wearing the kilt,’’ said ‘‘Brave’’ co-director Mark Andrews, who took the stage in his trademark Scottish garment.
The upbeat musical portrait ‘‘Searching for Sugar Man’’ took the documentary feature prize. The film follows the quest of two South African fans to discover the fate of acclaimed but obscure singer-songwriter Sixto Rodriguez, who dropped out of sight after two albums in the 1970s and was rumored to have died a bitter death.
‘‘Thanks to one of the greatest singers ever, Rodriguez,’’ said ‘‘Sugar Man’’ director Malik Bendjelloul.
There was a rare tie in one category, with the Osama bin Laden thriller ‘‘Zero Dark Thirty’’ and the James Bond tale ‘‘Skyfall’’ each winning for sound editing.
William Shatner made a guest appearance as his ‘‘Star Trek’’ character Capt. James Kirk, appearing on a giant screen above the stage during MacFarlane’s monologue, saying he came back in time to stop the host from ruining the Oscars.
‘‘Your jokes are tasteless and inappropriate, and everyone ends up hating you,’’ said Shatner, who revealed a headline supposedly from the next day’s newspaper that read, ‘‘Seth MacFarlane worst Oscar host ever.’’
The performance-heavy Oscars also included an opening number featuring Charlize Theron and Channing Tatum, who did a classy dance while MacFarlane crooned ‘‘The Way You Look Tonight.’’ Daniel Radcliffe and Joseph Gordon-Levitt then joined MacFarlane for an elegant musical rendition of ‘‘High Hopes.’’
Halle Berry introduced a tribute to the Bond franchise, in which she has co-starred, as the British super-spy celebrated his 50th anniversary on the big-screen last year with the latest adventure ‘‘Skyfall.’’ Shirley Bassey sang her theme song to the 1960s Bond tale ‘‘Goldfinger.’’ Later, pop star Adele performed her theme tune from ‘‘Skyfall,’’ which won the best-song Oscar.
Barbra Streisand injected some musical sentiment into the show’s segment memorializing Hollywood figures who died in the past year as she sang ‘‘The Way We Were,’’ the Oscar-winning song she did in the film of the same name.
A salute to the resurgence of movie musicals in the last decade included Oscar winners Zeta-Jones singing ‘‘All That Jazz’’ from ‘‘Chicago’’ and Hudson doing ‘‘And I Am Telling You I'm Not Going’’ from ‘‘Dreamgirls.’’ Hathaway and Jackman joined cast mates of best-picture contender ‘‘Les Miserables’’ to sing songs from their musical.
Academy officials said all performances were sung live.
Fans had pondered how far MacFarlane the impudent creator of ‘‘Family Guy,’’ might push the normally prim and proper Oscars. MacFarlane was generally polite and respectful, showcasing his charm, wit and vocal gifts.
MacFarlane did press his luck a bit on an Abraham Lincoln joke, noting that Raymond Massey preceded ‘‘Lincoln’’ star Daniel Day-Lewis as an Oscar nominee for 1940’s ‘‘Abe Lincoln in Illinois.’’
‘‘I would argue that the actor who really got inside Lincoln’s head was John Wilkes Booth,’’ MacFarlane wisecracked, earning some groans from the crowd. ‘‘A hundred and 50 years later, and it’s still too soon?’’
AP writers Christy Lemire, Sandy Cohen, Beth Harris and Anthony McCartney contributed to this report.