RIYADH, Saudi Arabia â President Trump, whose dark, guttural demonization of Muslims was a trademark of his nationalist campaign, arrives here Saturday hoping the Arab world will listen to a new message.

Embarking on his first overseas trip as president, Trump plans to do a rhetorical pirouette with a speech Sunday in the birthplace of Islam preaching religious tolerance and inviting Muslims to join the United States in the fight against global terrorism.

Never mind that as a candidate Trump proposed banning Muslims from entering the United States, or that he warned of a âTrojan horseâ filled with refugees slaughtering innocent Americans, or that he proclaimed, âIslam hates us.â

The Saudis are preparing to welcome President Trump like a conquering king when he steps off Air Force One for his first stop of a high-stakes, marathon tour through the Middle East and Europe.

The capstone of Trumpâs 48 hours in Riyadh will be a speech he delivers to the leaders of about 50 Muslim countries at a summit here Sunday afternoon. Trumpâs advisers have previewed the address as a clarion call for the Islamic world to partner against evil.

National Security Adviser H.R. McMaster described it as âan inspiring, yet direct speech on the need to confront radical ideology and the presidentâs hopes for a peaceful vision of Islam to dominate across the world.â

âThe speech is intended to unite the broader Muslim world against common enemies of all civilization and to demonstrate Americaâs commitment to our Muslim partners,â McMaster said.

Trumpâs apparent about-face on Islam is only the latest example of him reversing his campaign position or rhetorical tone since being elected president.

âHe has changed his position on lots of matters.â.â.so thereâs no particular reason he canât say whatever he wants to say,â said Eliot Abrams, a former national security official in the George W. Bush administration. âThis is more delicate because itâs a religion youâre talking about.â

Trumpâs speech is being written by Stephen Miller, the White House senior policy adviser who rose to prominence in the early days of Trumpâs presidency as the author and public face of the travel ban prohibiting people from seven (later restricted to six) majority-Muslim nations from entering the United States.

Miller, who traveled with Trump on the campaign trail and penned many of his speeches, has advocated a nationalist ideology that seeks to limit immigration to people who share what he considers to be American values.

President Trump and first lady Melania Trump walk across the South Lawn of the White House to board Marine One May 19 and fly to Andrews Air Force Base before departing for Saudi Arabia. (Jabin Botsford/The Washington Post)

Millerâs writings as a student in high school and college emphasized the threat of radical Islamic terrorism. He led a âTerrorism Awareness Projectâ at Duke University, warned of âIslamofascismâ and argued that there was a âholy war being waged against us.â His earlier writings were even more blunt, arguing that talk of how âpeaceful and benignâ Islam is âcannot change the fact that millions of radical Muslims would celebrate your death for the simple reason that you are Christian, Jewish or American.â

Trumpâs political ascent was fueled by similar anti-Muslim sentiments. For years, Trump repeatedly the false suggestion that then-president Barack Obama was not Christian and might be Muslim. Once he became candidate, Trump drew loud applause at his rallies when he railed against Muslim migrants.

âThis could be the greatest Trojan horse. This could make the Trojan horse look like peanuts if these people turned out to be a lot of ISIS,â Trump said of refugees from war-torn Syria in an October 2015 interview.

Trump called for âa total and complete shutdown of Muslims entering the United Statesâ in December 2015, saying that âit is obvious to anybody the hatred is beyond comprehension.â

Trump repeatedly told an apocryphal tale about U.S. Gen. John J. Pershingâs forces fighting Muslim insurgents in the Philippines in the early 1990s. In the story, they dipped bullets in pigsâ blood, loaded their rifles and firing them at the insurgents.

And in March 2016, Trump told CNN, âI think Islam hates us.â.â. Thereâs a tremendous hatred. We have to get to the bottom of it. Thereâs an unbelievable hatred of us.â

Trumpâs harsh campaign rhetoric appears to have set the bar extremely low in the minds of many in the Middle East.

âNo one is going into this thinking that Trump is good on Islam. Weâre all going into it with the opposite idea,â said Shadi Hamid, a senior fellow at the Brookings Institution who specializes in U.S.-Islamic relations. âThose low expectations might work in Trumpâs favor because as long as he takes care to avoid saying something terribly offensive, it might be seen as neutral or even positive.â

Trump previewed his new, less strident tone on Islam when he signed a religious liberty executive order earlier this month. Speaking in the Rose Garden of the White House, the president called the United States âa nation of toleranceâ that âhonors the freedom of worship.â

Trump said he would carry that theme to Saudi Arabia, home to two of Islamâs holiest sites, where he hopes to âconstruct a new foundation of cooperation and support with our Muslim allies.â

Trump intends his address Sunday as a contrast to Obamaâs 2009 speech in Cairo, when expectations were high that he would usher in a new era in U.S.-Middle East relations after nearly a decade of war in Iraq and Afghanistan. Obama said âAmerica and Islam are not exclusive, and need not be in competition,â but share common principles.

But Obamaâs outreach drew mixed reviews, and tensions built over some of his administrationâs actions that followed regarding Iranâs nuclear ambitions, the Arab Spring and the conflict in Syria.

While Obama often promoted human rights and democracy when he traveled abroad, Trump has signaled he will not and has ingratiated himself with some authoritarian leaders whose citizens are denied basic rights.

âOur task is not to dictate to others how to live, but to build a coalition of friends and partners who share the goal of fighting terrorism and bringing safety, opportunity and stability to the war-ravaged Middle East,â Trump said in his Rose Garden remarks.

Trumpâs audience here Sunday will be the leaders of many Muslim nations that are not democratic states. Among them is Saudi Arabia, which is a rigidly controlled society that adheres to a form of Islam, Wahhabism, that some view as extremist, noted Abrams, a senior fellow at the Council on Foreign Relations.

âIt will be very interesting to see if human rights and democracy will be completely ignored in this speech,â Abrams said.

In some respects, Trumpâs posture represents at least a partial return to the position of former president George W. Bush, who emphasized that violent extremism does not represent Islam as a faith, which he saw as essential to promoting peace. Bush placed the first copy of the Holy Koran in the White House library, and encouraged Americans to travel to the Muslim world, welcome Muslim students into their homes for cultural exchange and study Arabic.

Trump has made no such entreaties. In fact, he has criticized Saudi Arabia for wanting âwomen as slaves and to kill gays,â as he put it in a 2016 Facebook post attacking rival Hillary Clinton for accepting donations from the Saudis at her familyâs charitable foundation.

But Trumpâs hosts in Riyadh see those remarks as being from a lifetime ago, at least if their public comments are any indication. Adel al-Jubeir, the Saudi foreign minister, said in a statement, âLeaders of Arab and Islamic nations and the United States recognize the importance of strong and enduring partnerships to confront the threat of violent extremism.â

With hundreds of American and Saudi flags lining the streets here, the minister added, âThere are many who try to find gaps between the policy of the United States and that of Saudi Arabia, but they never will succeed. The position of President Trump, and that of Congress, is completely aligned with that of Saudi Arabia.â

Phillip reported from Washington. Abigail Hauslohner and Jenna Johnson in Washington contributed to this report.