McQueen also thanked the film's producers, starting with actor Brad Pitt, "without whom this film would not have been made."
Pitt, preceding McQueen on the podium, said it was "an absolute privilege to work on Solomon's story."
Besides Best Picture, "12 Years a Slave" won two more Oscars: for John Ridley's adapted screenplay, and a supporting-actress prize for Lupita Nyong'o, the Yale-educated daughter of a Kenyan politician in her first significant major movie role.
In a tearful acceptance speech, Nyong'o said, "When I look at this golden statue, may it remind me and every little child that no matter where you're from, your dreams are valid."
The movie that won the most Oscars, with seven, was "Gravity," director Alfonso Cuarón's white-knuckle space thriller about two astronauts (Sandra Bullock and George Clooney) trying to get home after their space shuttle is destroyed.
Cuarón won two Oscars, for directing and (with Mark Sanger) editing the film. "Gravity" also won for Emmanuel Lubezki's cinematography, Steven Price's score, and three technical categories — sound editing, sound mixing and visual effects.
Cuarón said making a movie is "transformative," before joking that "what really sucks is that for many of these people, that transformation was wisdom, while for me, it was just the color of my hair."
"Dallas Buyers Club" won the two male acting prizes, for lead actor Matthew McConaughey and supporting actor Jared Leto.
McConaughey portrayed Ron Woodroof, a Texas good-ol'-boy who fights the medical establishment when he's diagnosed with AIDS in 1987. Leto played Woodroof's fictionalized assistant, the transgender HIV sufferer Rayon.
In his acceptance speech, before he let loose with his trademark "alright, alright, alright," McConaughey described his hero: "It's me in 10 years. … I'm never going to beat my hero. It gives me someone to keep chasing."
Leto, the first award-winner of the night, gave a heartfelt speech that covered the AIDS crisis, uprisings in Ukraine and Venezuela, his single mom, and his rock band 30 Seconds to Mars.
"This for the 36 million people who have lost the battle to AIDS — and to those of you out there who have ever felt injustice because of who you are or who you love — tonight I stand here in front of the world with you and for you," Leto said.
The Best Actress Oscar went to Cate Blanchett, for playing a down-on-her-heels Manhattan socialite in Woody Allen's "Blue Jasmine."
In a charmingly comic speech, Blanchett got serious when she talked about "Blue Jasmine's" financial success. "Perhaps those of us in the industry who are still foolishly clinging to the idea that female films — with women at the center — are niche experiences. They are not. Audiences want to see them, and in fact they earn money."
Other multiple winners: Baz Luhrmann's extravagant "The Great Gatsby," which won for production design and costume design; and Disney's musical fable "Frozen," which won for animated feature and for its signature song, "Let It Go."
Host Ellen DeGeneres was consistently funny, engaging the stars in Dolby Theatre audience by serving up pizza and by taking a group selfie that broke a record for retweets — and briefly shut down Twitter.
DeGeneres' comedy was mostly non-threatening, compared to last year's host, "Family Guy" creator Seth McFarlane. One DeGeneres monologue joke did sting, as she forecast the night's outcome: "Possibility No. 1: '12 Years a Slave' wins best picture. Possibility No. 2: You're all racists."
Even with "12 Years a Slave" a prominent winner this awards season — at the Oscars, the Golden Globes, the BAFTAs and the Independent Spirit Awards — some critics complained about the short shrift given to movies about race relations in more recent eras. Neither "Lee Daniel's The Butler" (set during the civil-rights era) or the 2013 Sundance Film Festival winner "Fruitvale Station" (about the 2009 killing of a black Oakland man by a Bay Area transit cop) received any Oscar nominations.