In its final moments, the 91st Academy Awards stayed on message Sunday by honoring a movie that captured the ceremony’s running theme of breaking color barriers.

It just wasn’t the movie many people thought it would be.

The night’s big surprise had seemingly come minutes earlier, when Olivia Colman was named outstanding actress for “The Favourite,” making sentimental favorite Glenn Close a seven-time loser.

But you could practically hear viewers ripping up their Oscar-pool predictions when Julia Roberts announced “Green Book” as best picture. “Roma,” Alfonso Cuarón’s affectionate look back at his Mexico City childhood, was expected to break new ground as the first foreign-language champ, not to mention a feather in the cap for the streaming service Netflix.

Instead, voters went with “Driving Miss Daisy II.” Despite its good intentions, many felt the movie, directed by the man behind “Dumb and Dumber,” treated serious race issues too lightly. Its upset win will most likely will go down as one of the most head-scratching victories in Oscar history.

Cuarón wasn’t completely stiffed; far from it. In addition to “Roma” being named best foreign-language film, its writer/director won two Oscars, surpassing such peers as Steven Spielberg in the win column.

“Being here doesn’t get old,” said Cuarón, after sharing a long hug with best-director presenter and fellow Mexican Guillermo del Toro. “Gracias, gracias, gracias.”

Cuarón thanked the motion-picture academy “for recognizing a film centered around an indigenous woman, one of the 70 million domestic workers in the world without work rights, a character that has historically been relegated in the background in cinema.

“As artists, our job is to look where others don’t.”

“BlacKkKlansman” filmmaker Spike Lee shared an award for best adapted screenplay, triggering an enthusiastic response led by presenter Samuel L. Jackson, who announced his longtime collaborator’s name as if he had just scored the winning goal in the World Cup.

Lee, who was given an honorary Academy Award in 2015 but had never won in a competitive category, paid tribute to his grandmother, who saved her Social Security checks to finance his college education, and urged people to mobilize for the 2020 presidential election.

“Let’s do the right thing,” he said, decked out in a wardrobe that was partly inspired by Prince. “You know I had to get that in there,” he added, referencing his 1989 classic that wasn’t even nominated for best picture. “Do the Right Thing” did earn Lee the first of his four Oscar nominations (he lost to “Dead Poets Society” for best original screenplay) while “Driving Miss Daisy” went on to win the top prize.

"Every time somebody's driving somebody, I lose," joked Lee, whose movie was a best-picture contender this time around, in the press room backstage.

Nonetheless, people of color made their way to the stage throughout the evening.

Rami Malek was named best actor for his uncanny impression of Freddie Mercury in “Bohemian Rhapsody.”

“I may not have been the obvious choice, but I guess it worked out,” Malek said. “I am the son of immigrants from Egypt ... Part of my story is being written right now.”

Mahershala Ali, a 1999 graduate of the Guthrie Theater’s Experience for Actors, won the supporting actor trophy for “Green Book,” adding to his win for “Moonlight” in the same category two years ago. Denzel Washington is the only other black actor to repeat at the Oscars.

“I want to dedicate this to my grandmother, who has been in my ear my entire life, telling me, ‘If at first I don’t succeed, try, try again,’ ” Ali said.

Regina King, who already owns three Emmys, added an Oscar to her mantel with her win for “If Beale Street Could Talk,” joining Halle Berry and Viola Davis as the only black actresses to triumph at both events.

She opened her acceptance speech with a shout-out to James Baldwin, the author of the book on which the movie was based, calling him “one of the greatest artists of our time.”

Her win means Chanhassen Dinner Theatres veteran Amy Adams (“Vice”) has gone 0 and 6 at the Oscars. But at least she’s not the “biggest loser” among actresses. That title still belongs to Close.

Jimmy Chin, a Mankato native who graduated from Carleton College, shared the honors for best documentary, along with his wife, Elizabeth Chai Vasarhelyi, for their profile of look-ma-no-ropes climber Alex Honnold.

Vasarhelyi thanked the film’s production company, National Geographic, “for believing in us and for hiring women and people of color because we only help make the films better.”

Her win was part of an historic night for women. By the evening’s end, 15 women had won Oscars, topping the previous total of 13.

Peter Ramsey became the first black man to be honored for outstanding animated feature, when the film he codirected, “Spider Man: Into the Spider-Verse,” took its place in the winner’s circle.

Ruth E. Carter capped a 30-year career when she was named best costume designer for her work in “Black Panther.” She is the first black person to win in that category.

“This has been a long time coming,” she said, going out of her way to thank Lee, who was the first director to give her a Hollywood job.

Hannah Beachler, who did the production design for “Panther,” also broke barriers by becoming the first black to come out on top in her category.

With no host, the night opened with two numbers from Queen, fronted by “American Idol” favorite Adam Lambert, and nervous celebrities doing their best to boogie in their seats without shimmying out of their dresses. There was no opening comedy monologue, but a number of the presenters earned laughs, particularly the trio of Amy Poehler, Tina Fey and Maya Rudolph. No one, however, killed as successfully as Colman, who spent much of her acceptance speech gobbling humble pie.

“Kids, if you’re not watching, then well done,” she said in thanking her children at home. “I sort of hope you are. This is not going to happen again.”

Other winners included the team behind “Green Book’s” original screenplay and the ballad “Shallow” from “A Star Is Born.”

“If you are at home and you are sitting on your couch, know that this is hard work,” said Lady Gaga, who co-wrote the winning number. “I’ve worked hard for a long time. It’s not about winning. What it’s about is not giving up. if you have a dream, fight for it. It’s not about how often you’re rejected ... It’s about how many times you stand up and keep on going.”