The coming-of-age drama Moonlight upset La La Land to win the best-picture Oscar in one of the wildest finishes ever for the Academy Awards, while The Salesman, a film by Iranian director Asghar Farhadi, won in the best foreign-language film category.
The ceremony on February 26 was plunged into chaos when presenter Faye Dunaway incorrectly announced that La La Land had won the best picture award. After the cast and crew accepted the award, an announcement was made that Moonlight had actually won, bringing that cast to the stage to accept.
Before the chaotic ending, the ceremonies had run smoothly, although they were tinged with political statements and jabs at U.S. President Donald Trump, including attacks on his immigration policies.
One of the strongest statements came from Farhadi, who boycotted the ceremony in protest of Trump’s controversial attempt to temporarily bar people from Iran and six other predominantly Muslim nations from entering the United States.
Iranian engineer and space tourist Anousheh Ansari accepted on Farhadi's behalf.
WATCH: Emma Stone Says Moonlight 'One Of Best Films' Ever
"I'm sorry I'm not with you tonight," Ansari read in a statement from Farhadi. "My absence is out of respect for the people of my country and those of other six nations who have been disrespected by the inhumane law that bans entry of immigrants to the U.S."
"Dividing the world into 'us' and 'our enemies' categories creates fear, a deceitful justification for aggression and war," Ansari read.
Farhadi and the film's leading actress, Taraneh Alidoosti, last month said they would not attend the event in protest of Trump's immigration order.
A U.S. federal judge halted the ban, but Trump has said his team is in the process of writing a new rule that will be introduced soon.
The Salesman is a Tehran-based drama about a married couple that struggles after the wife is attacked while alone in their apartment.
WATCH: Moonlight Team Celebrates Oscar Triumph
Iranian Foreign Minister Mohammad Javad Zarif congratulated Farhadi for the award and for protesting against Trump's executive order.
Zarif tweeted on February 27: "Proud of Cast and Crew of "The Salesman" for Oscar and stance against #MuslimBan. Iranians have represented culture and civilization for millennia."
Iranian state radio and television briefly reported on Farhadi's win.
La La Land, a musical, was nominated for 14 Oscars, winning six, including best actress and best direction.
Dunaway's co-presenter, actor Warren Beatty, paused before reading the big winner. He later explained that he hesitated when he saw what appeared to be the card for best actress -- Emma Stone for La La Land. Dunaway took the card and incorrectly announced La La Land as the winner.
Moonlight is about a boy's journey to adulthood through a tough upbringing in Miami with a drug-addicted mother.
Earlier, the Syrian war documentary The White Helmets won the Oscar for the best short documentary. The film is about rescue workers, some who have lost their lives, who struggle to save Syrians affected by the six-year civil war.
In other major categories, Casey Affleck won for best actor for Manchester by the Sea; Mahershala Ali won best supporting actor for Moonlight; Viola Davis won best supporting actress for Fences; and Damien Chazelle won best director for La La Land.