Moonlight tells the life story of a young African-American struggling to find his place as he grows up poor in Miami.
Hollywood legends Warren Beatty and Faye Dunaway, stars of 1967 crime classic "Bonnie and Clyde," were meant to give the evening's top prize to Jenkins's film, but she mistakenly called it for Damien Chazelle's musical.
Scenes of confusion and embarrassment followed after the "La La Land" crew -- already on stage and delivering speeches -- suddenly realized the mistake and announced that "Moonlight" had actually won, prompting Beatty to mumble apologies.
Backstage, "La La Land" star Emma Stone, who took home best actress honors, told stunned reporters: "You guys see that?"
"Moonlight" was a shock winner for best picture, after Chazelle's modern take on the all-singing, all-dancing Golden Age of Tinseltown's studio system, the runaway favorite, had taken six prizes -- best director, actress, score and song as well as two technical awards.
"The last 20 minutes of my life have been insane," Jenkins said backstage.
"All you people who feel like there's no mirror for you, the Academy has your back," he said earlier after winning for best adapted screenplay.
Starring Naomie Harris and Mahershala Ali -- who bagged the first of the movie's three Oscars -- "Moonlight" tells the life story of a young African-American struggling to find his place as he grows up poor in Miami.
The film has won plaudits as a vital portrait of contemporary African-American life and is praised in equal measure as a groundbreaking and personal meditation on identity, family, friendship and love.
It beat seven other films besides "La La Land" -- including alien thriller "Arrival" and family dramas "Manchester by the Sea" and "Fences" -- for best picture honors.
Despite the stunning finish, the overall winner of the night was still "La La Land".
Starring Stone and Ryan Gosling as an aspiring actress and a struggling jazz musician who fall in love in Los Angeles, it has charmed critics the world over and returned more than 10 times its $30 million budget.
"This was a movie about love and I was lucky enough to fall in love while making it," said Chazelle, 32, the youngest filmmaker by several months ever to win a best directing Oscar.
He paid tribute to girlfriend Olivia Hamilton, saying it "means the world" that she was sharing his success.
Justin Timberlake opened the gala night with some upbeat music, and Kimmel then wasted no time putting the A-list audience in a political frame of mind.
"This broadcast is being watched live by millions of Americans and around the world in more than 225 countries that now hate us," joked the 49-year-old Kimmel.
The late-night comedian quipped that Trump, who pulled off a political upset win with his campaign that targeted immigration, had taken the heat off Hollywood and its annual gala.
"I want to say thank you to President Trump. Remember last year when it seemed like the Oscars were racist? That's gone, thanks to him," Kimmel said.
This year's nominees have reflected a push by the Academy to reward diversity after the #OscarsSoWhite controversy of the past two years that prompted calls for a boycott of the annual bash.
Ali won the best supporting actor prize for his turn as a drug dealer with a heart in "Moonlight" while fellow African-American Viola Davis took the supporting actress statuette for her work in "Fences."
The most intriguing race was for best actor, which for weeks looked like a lock for "Manchester by the Sea" star Casey Affleck, but the 41-year-old had to fend off a late surge by Denzel Washington ("Fences") to take the trophy.
"One of the first people who taught me how to act was Denzel Washington, and I just met him tonight for the first time," said Affleck, who was a losing best supporting actor nominee in 2008.
Stone bagged her first statuette in the best actress category despite a late push from Isabelle Huppert, already a Golden Globe winner for edgy rape-revenge thriller "Elle."
"Manchester" went into the evening with six nominations but came away with only Affleck's win and a best original screenplay statuette for Kenneth Lonergan, who also directed the film.
The highlight of the technical Oscars was sound mixer Kevin O'Connell's win for "Hacksaw Ridge," which broke a losing streak that saw the coveted award elude him through 20 nominations.
"Hacksaw Ridge" also took the prize for sound mixing, while "La La Land" won for cinematography and production design.
The Oscars is the highlight of the Tinseltown calendar, and wraps up two months of glittering prize galas.
This awards season, the popping of champagne corks has been muted by the tense political situation in the United States.
Trump's controversial (and now halted) travel ban led Iranian director Asghar Farhadi to opt out of attending -- but a statement from Farhadi was read when his "The Salesman" was named best foreign language film.
Kimmel made mention of Trump's retort that Streep was "highly overrated" -- by recalling her record 20 nominations, and urging everyone to offer her a standing ovation. The audience willingly complied.