LOS ANGELES — Oscar voters showered the neo-musical “La La Land” with 14 nominations on Tuesday, a tie with “Titanic” and “All About Eve” for the most in Academy Award history. But the academy also moved past two #OscarsSoWhite years by honoring six black actors — a record — and including diverse films like “Moonlight,” “Fences” and “Hidden Figures” in the best picture race.

“It makes me feel good to see such a multifaceted group of people get recognized,” said Barry Jenkins, the director of “Moonlight,” which received eight nominations. Speaking by phone from Amsterdam, where he was promoting the film, he added, “It’s an affirmation that film has the power to erode barriers and reveal what makes us all human.”

Nine movies, most of them cobbled together outside the studio system, will compete for Hollywood’s top prize. Filling out the best picture race are “Arrival,” a science-fiction thriller; the cops-and-robbers drama “Hell or High Water”; “Manchester by the Sea,” about a mournful New England handyman; the subtitled tear-jerker “Lion”; and “Hacksaw Ridge,” Mel Gibson’s true story of World War II heroism.

In a surprise, Mr. Gibson also drew a nomination as best director, officially ending his 10-year status as a Hollywood pariah for his offscreen behavior. Joining him in the directing field were Damien Chazelle (“La La Land”), Denis Villeneuve (“Arrival”), Mr. Jenkins (“Moonlight”) and Kenneth Lonergan (“Manchester by the Sea”).

Perhaps the biggest upset happened in the best actress category. “Arrival” emerged as one of the most-honored films, with support in eight categories, but its star, Amy Adams, failed to receive a nod for best actress. Even worse, a website managed by the Academy of Motion Picture Arts and Sciences and ABC, which broadcasts the Oscars, initially listed her as a nominee. ABC took the blame, citing a rush to post names. “We apologize to the academy, press and fans for any confusion,” the network said in a statement. ABC also mistakenly named Tom Hanks as a best actor candidate for “Sully.”

Denzel Washington and Viola Davis in “Fences.” Mr. Washington was nominated for best actor and Ms. Davis for best supporting actress. Credit David Lee/Paramount Pictures, via Associated Press
While excluding Ms. Adams, whose performance has been honored by numerous other awards groups, academy voters backed Isabelle Huppert from the French film “Elle,” Emma Stone from “La La Land,” Natalie Portman from “Jackie,” Meryl Streep from “Florence Foster Jenkins” and the newcomer Ruth Negga from “Loving.” It was Ms. Streep’s 20th career nomination; her speech about President Trump at the Golden Globes likely won her votes. (She reacted to her nomination by releasing a happy dance GIF.)

Several other legends were snubbed. Voters refused to throw Martin Scorsese’s box-office bomb “Silence” a lifeline, offering a lone nod for cinematography. And Clint Eastwood’s “Sully” had to make do with one nomination, for sound editing. Once again, the academy stubbornly refused to bow in the direction of popular movies; the hard-campaigning “Deadpool” got nothing, even in work-a-day categories.

As expected — and despite renewed attention on sexual-harassment lawsuits that he settled in 2010 — Casey Affleck, the star of “Manchester by the Sea,” continued his march toward the Oscar podium. He will vie for best actor alongside Denzel Washington (“Fences”), Andrew Garfield (“Hacksaw Ridge”), Ryan Gosling (“La La Land”) and Viggo Mortensen (“Captain Fantastic”).

Taraji P. Henson, far left, Octavia Spencer and Janelle Monáe in “Hidden Figures,” which was nominated for best picture. Credit Hopper Stone/20th Century Fox Film Corporation
In a sharp contrast to the previous two years, when the academy put forward all-white rosters of acting nominees, voters chose the largest number of black candidates ever. Mahershala Ali and Naomie Harris each received a nod for their supporting work in “Moonlight,” a poetic drama about a young black man in Miami. Viola Davis (“Fences”) and Octavia Spencer (“Hidden Figures”) were also nominated for supporting actress. Joining Ms. Negga in the lead categories was Mr. Washington of “Fences,” an adaptation of August Wilson’s classic play about black life in 1950s Pittsburgh.

More Than One on the Ballot
In 1940 Hattie McDaniel became the first African-American performer to be nominated for an Oscar (she won best supporting actress). Others followed but it wasn’t until 1968 that two or more black performers were nominated in the same year. In subsequent Oscar races, one movie would often be responsible for multiple nominations. This year, six black actors and actresses — in four different films — were nominated, a record.

Another minority actor, Dev Patel, was nominated for his supporting role in “Lion,” which received six nominations in total, tying “Manchester by the Sea” and “Hacksaw Ridge.” And four of the five honored documentaries came from black filmmakers, including “The 13th,” Ava DuVernay’s searing look at race and mass incarceration in America, and “I Am Not Your Negro,” directed by Raoul Peck, a portrait of the writer James Baldwin and the civil-rights era. (The others in that race are “Fire at Sea,” “Life, Animated” and the seven-hour “O.J.: Made in America,” which paves the way for TV documentaries given limited theatrical release to be nominees.)

Pundits will inevitably declare that the academy listened to the #OscarsSoWhite protests that found the Rev. Al Sharpton berating Hollywood in a preceremony rally last year. The academy made drastic membership changes in 2016, revoking the voting privileges of long-nonworking members and inviting more women and minorities to join. (The 7,000-member group remains overwhelmingly white and male, however.)

Amy Adams and Jeremy Renner in “Arrival,” which was nominated for best picture. Credit Jan Thijs/Paramount Pictures
Public pressure may have been a factor in the outcome on Tuesday, but the results almost assuredly have more to do with the vagaries of moviemaking: a full slate of high-quality movies with diverse casts that coalesced in the past year.

Still, race continues to be a hot-button topic around the Oscars. Last week, one academy voter, Santiago Pozo, voiced brewing discontent among Latinos, writing in the trade publication Deadline.com that underrepresentation of other minorities — not just black actors — in Hollywood is “a terminal illness for our business and for the relevance of the Academy Awards.” The Los Angeles Times weighed in with a similar editorial on Tuesday, noting that there were almost no Hispanic nominees.

One exception: Lin-Manuel Miranda received a nod for his original “Moana” song “How Far I’ll Go,” putting him one step closer to the rarefied club known as EGOT, or those who have won an Emmy, Grammy, Oscar and Tony. (Mr. Miranda, a first-time Oscar nominee, already has an Emmy, two Grammys and three Tonys.)

Ruth Negga, second from right, and Joel Edgerton, right, in “Loving.” Ms. Negga received a best actress nod. Credit Ben Rothstein/Focus Features
Among companies, Amazon was a big winner on Tuesday, beating Netflix to become the first internet company to earn an Academy Award nomination for best picture. Amazon bought “Manchester by the Sea” at last year’s Sundance Film Festival. With 26, Lionsgate received the most nominations of any studio; its contenders include “La La Land” and “Hell or High Water,” a partnership with CBS Films.

The Oscars will be broadcast on Feb. 26. Jimmy Kimmel, who anchors ABC’s late-night programming block, was selected as host.

The academy entrusted its previous ceremony to the producers Reginald Hudlin and David Hill, who brought in Chris Rock to scold Hollywood on diversity and created a cable-news-style scrawl in an ill-advised attempt to make acceptance speeches more interesting. Ratings dropped, and ABC, which broadcasts the ceremony and charges more than $2 million for a 30-second commercial, moved to take a firmer hand in this year’s telecast.