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 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.

ABOUT-FACE ON ISLAM

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 Elliott 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.”

THE SPEECHWRITER

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 during the campaign 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.

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 repeated the false suggestion that then-President Obama was not Christian and might be Muslim. Once he became a candidate, Trump drew loud applause at his rallies when he railed against Muslim migrants.