Ryan Gosling performs ‘I’m Just Ken’ at Oscars

HOLLYWOOD, CALIFORNIA - MARCH 10: Ryan Gosling performs 'I'm Just Ken' from "Barbie" onstage during the 96th Annual Academy Awards at Dolby Theatre on March 10, 2024 in Hollywood, California. (Photo by Kevin Winter/Getty Images)

Ryan Gosling gave the people what they wanted when he performed "I’m Just Ken" from the movie "Barbie," during the Oscars ceremony Sunday

Gosling dazzled audiences in a dark pink suit while singing in the audience before taking center stage. 

Gosling — the Ken to Margot Robbie's "Barbie" in the film  – received a supporting nomination for his role in the movie, and "I’m Just Ken" was nominated for best original song.

However, he lost the award to another song on the Barbie soundtrack, "What Was I Made For?" by Billie Eilish and Finneas.

RELATED: Oscars 2024: See the list of winners

"I’m Just Ken" is performed by Gosling in the Hollywood blockbuster, which was easily the biggest hit of the year with more than $1.4 billion in ticket sales.

In February, the actor told Variety that he would "be open" to performing at the awards show, but said he hadn’t yet been asked to perform.

"It might be too much of a risk to have me do it," Gosling said, adding, "I don’t know how that would work. But I’m open to it."

RELATED: John Cena appears nude while presenting Oscar for costume design

"I’m Just Ken" is one of two "Barbie" tracks that earned an Oscar nomination for best original song. The other is "What Was I Made For?" by Billie Eilish and Finneas, which won the Grammy for best song written for visual media over "I’m Just Ken."

In December, Gosling released the "I'm Just Ken" EP alongside collaborators Mark Ronson and Andrew Wyatt. 

Stephanie Weaver contributed to this report. This story was reported from Los Angeles.