Moonlight took home three statues at Sunday's 89th Academy Awards, including the Oscar for Best Picture.

Based on Tarell Alvin McCraney's play In Moonlight Black Boys Look Blue, Moonlight, written and directed by Barry Jenkins, follows an African-American man (played by Trevante Rhodes) who struggles to come out gay over three periods of his life while growing up in a rough neighborhood of Miami.

The film beat out La La Land, considered a favorite, Fences, Hidden Figures, Hacksaw Ridge, and others to win the night's biggest prize.

In a stunning turn of events for the film, Moonlight emerged as the Best Picture winner after presenter Warren Beatty announced La La Land as the winner and producers and cast for that film had made their way onstage.

“Personally, I blame Steve Harvey for this,” host Jimmy Kimmel joked, a reference to Harvey's gaffe where he crowned the wrong winner of the 2015 Miss Universe pageant.

Mahershala Ali beat out Jeff Bridges (Hell or High Water), Lucas Hedges (Manchester by the Sea), Deve Patel (Lion) and Michael Shannon (Nocturnal Animals) to win in the Supporting Actor category for his role in Moonlight. Ali is the first Muslim to win an acting Oscar.

Moonlight also won for Best Adapted Screenplay.

In accepting the award, McCraney, who was joined on the stage by Jenkins, dedicated the win to “all those black and brown boys and girls and non-gender-conforming who don't see themselves. We're trying to show you you and us. So thank you, thank you, this is for you.”