NEW YORK -  Famed Iranian filmmaker Asghar Farhadi spoke out against US President Donald Trump's move to ban immigrants from some Muslim countries in a poignant statement read out for him at the Oscars on Sunday night when Farhadi, who stayed home in protest, won the award for best foreign film -- The Salesman.

Farhadi, the two-time Oscar winner, sent a representative, astronaut Anousheh Ansari -- the first Muslim woman in space -- to accept the award for him and to read his statement apologising for not being there. Farhadi chose not to travel to the US for the ceremony to protest a pending Trump order forbidding any Syrian refugees and a temporary ban on immigrants from seven Muslim-majority countries, including Iran.

"It is out of respect for the people of my country and the other six disrespected by the inhuman law that bans entry of immigrants to the United States," his statement read, to big applause.

"Dividing the world into the 'us' and 'our enemies' categories creates fear—a deceitful justification for aggression and war," Farhadi added.

He also suggested that filmmakers have a role to play. "They create empathy between us and others. An empathy which we need today more than ever," he said. That was followed by Gael García Bernal, presenting the nominees for best animated feature film, who spoke out against "walls," like the one Trump intends to build at the 2,000-mile border with Mexico.

“Flesh and blood actors are migrants, we travel all over the world, we build families, we construct stories, we build life that cannot be divided," García Bernal said. "As a Mexican, as a Latin American, as a migrant worker, as a human being, I’m against any form of walls that want to separate us.”

In an unprecedented move, all five nominated directors for best foreign language films released a statement before the broadcast expressing their disapproval of "the climate of fanaticism and nationalism we see today in the US and so many other countries." They also expressed their disappointment "most unfortunately of all, among leading politicians."

Also affected by the travel ban was the head of a group of Syrian volunteers featured in the Oscar-winning documentary "The White Helmets." Instead, the producers read a statement from Raed Saleh, who is Syrian and the leader of the Syria Civil Defence group, saying how grateful they are that this film has highlighted their work of saving more than 82,000 civilian lives. Saying, "it's very easy for these guys to feel they've been forgotten," the film's producer asked the audience to "stand up and tell them how much we want this war to end as soon as possible." Politics were present from the start of the ceremony, beginning with this year's host Jimmy Kimmel's opening monologue.

Kimmel started off the night on a serious note, urging everyone watching the telecast to "reach out to one person you disagree with and a have a positive conversation." He said that is what could "make America great again" -- a dig at Trump's campaign slogan. He later joked about topics like Homeland Security, alluding to President Trump's immigration ban from earlier this year and touched on Trump's "overrated" tweet about Meryl Streep, stemming from her speech this year at the Golden Globe Awards. Kimmel joked about the 20-time Oscar nominee's "mediocre early work" and "underwhelming" performances, adding that she's "phoned it in for more than 50 films."

Then he made Streep get up for an "undeserved" standing ovation from the audience. After a commercial break, Kimmel brought up the recent ban of certain news organisations from an off-camera White House briefing last Friday.

"CNN, LA or NY Times ... please leave the building, we have no tolerance for fake news," he joked, adding that other "fake" items were allowed. The political theme continued as the speeches began, starting with the Italian winners of the Oscar for best makeup and hairstyling. "I'm an immigrant," one of the winners declared, dedicating his Oscar to other immigrants and drawing a round of applause from the audience. That was followed by the winner of the best documentary feature. Producer and director Ezra Edelman accepted his award on behalf of victims of police violence, police brutality and criminal injustice. "This is their story as well as Ron's and Nicole’s," he said, referring to murder victims Ron Goldman and Nicole Brown. Viola Davis continued the theme, paying tribute to everyday people as she accepted her first Oscar for best supporting actress. "You know, there's one place with all the people with the greatest potential are gathered, and that's the graveyard," she said. "People ask me all the time, 'What kind of stories do you want to tell, Viola?' And I say, exhume those bodies, exhume those stories. The stories of the people who dream big and never saw those dreams to fruition. People who fell in love and lost." After Davis speech, in which she brought many in the audience to tears, Kimmel joked that she should get an Emmy nomination just for speech. Accepting the award for best adapted screenplay, "Moonlight" director Barry Jenkins told the audience, "If you feel like there is no mirror for you, the Academy has your back, the ACLU has your back, we have your back and over the next four years we will not leave you alone. We will not forget you."

Host Kimmel also got really specific: Don't be surprised, he said, if the Oscars ended up being trashed by Trump. "Some of you will win and give a speech that the president of the United States will tweet about in all caps during his 5am bowel movement."

Subtle allusions to Trump policies included the speech by one of the winners for the best documentary short subject, White Helmets, about the herculean rescue efforts in Syria, who asked everyone to stand up if they supported Syrian refugees and an end to the war there (everyone stood up); a winner who gave a shout-out for public schools; and one of the winners for best adapted screenplay, for Moonlight, who declared support for LBGT kids.

Earlier on Sunday, Trump was continuing his Twitter war with the "failing" New York Times, which is scheduled to air its first ever 30-second ad during the Oscars — about the truth and independent journalists’ role in finding it.

"For first time the failing@nytimes will take an ad (a bad one) to help save its failing reputation. Try reporting accurately & fairly!," Trump tweeted Sunday morning.

The Times tweeted a link to its story on host Kimmel and his challenge in finding the balance between too much politics and too little at the Oscars.