A very different Donald Trump took the microphone in Riyadh, Saudi Arabia, today. Gone was the Muslim ban president — we saw a relatively conventional president who recognized what every other leader has realized before him: that he needs allies, even if he’s loath to go about gathering them.

In a speech billed as an effort to reconcile with the Muslim world while simultaneously galvanizing Middle Eastern nations to join the United States in an effort to combat terrorism, Trump spoke of a battle between “good and evil.”

But he also drew a distinction new for an administration that has long positioned itself contrary to Islam. "This is not a battle between different faiths,” he said, as quoted in the advance version of the speech, “different sects, or different civilizations. This is a battle between barbaric criminals who seek to obliterate human life, and decent people of all religions who seek to protect it.”

Here, finally, was an acknowledgement that Islam itself was not the enemy. Nowhere in his speech was his rallying cry to fight “radical Islamic terrorism,” a phrase he insisted upon inserting in speech after speech, even as his advisers begged him to stop. Today, he softened that phrase to a vow to fight “Islamic extremism.” He spoke of “shared interests” and “common security.”

It was a speech about terror and radicalism, in other words, that would have been relatively unremarkable for any of the past three presidents. And that’s what made it all the more remarkable for Trump: This was a pivot to relative restraint for a man who had campaigned for president on an us-versus-them platform that placed Muslims on the far side of “them.”

Today, in careful language, he appealed to a room filled with more than 50 Muslim leaders, and a worldwide audience of more than 1.8 billion Muslims, including 3.3 million Muslims in the United States. He carefully positioned Islam with the United States on the side of civilization, of counterterrorism, and drew a distinction between terrorism and Islam itself. And, as promised, he insisted that Muslims, and Muslim nations, not only join him to fight radicalism and terror around the world, but to take the lead in that effort.

“Our goal is a coalition of nations who share the aim of stamping out extremism and providing our children a hopeful future that does honor to God ... Every time a terrorist murders an innocent person, and falsely invokes the name of God, it should be an insult to every person of faith,” he said, as quoted in an advance text of the speech made available to press.

Embattled at home, these are the headlines Trump was hoping would follow him in the Middle East: he would like this speech to show a president re-engaging with the region, shoring up relationships with old friends and making new ones, all in a united battle against a problem of global extremism.

But he had to overcome tremendous skepticism, given his reputation for Muslim bashing, and his hard-fought efforts to ban Muslims from entering the United States.

“From a rhetorical and practical perspective, the way you build hope is not to position yourself as against someone else,” said Hussein Rashid, a professor of religion at Barnard College, “and Trump cannot imagine himself except in opposition to someone else.”

The very idea of the Muslim ban president delivering a speech on Islam, in Saudi Arabia, as my colleague Jennifer Williams pointed out on Friday, seemed all but completely absurd. And yet in his speech today, Trump has mostly managed to not offend, which is more than many hoped.

No one was quite sure which Trump would arrive in Riyadh

The inevitable comparison to Trump’s speech will be with President Barack Obama’s 2009 speech in Cairo, Egypt, which was billed as a “new beginning” for the US-Muslim world relationship. It was a thoughtful speech, appealing to ideals of democracy and a shared future. Obama, said Rashid, spoke of “American ideals and brought in Muslim history to illustrate those ideals. He was trying to align the best of America with the best of the religion”

He added, “it wasn’t a parent talking to a child. It was a partner speaking to another partner.” But, in retrospect, many of its aspirations were not met — leaving the region potentially open to a conversation with someone else. Even someone known for his dismissal of Islam.

“I think Islam hates us,” Trump said in 2016. During the campaign he toyed with the idea of a Muslim registry, proposed a “total and complete shutdown of Muslims entering the United States,” and then, assiduously, tried to institute that ban. However softened his message may be, it comes on the heels of that recent history.

Trump ran a presidential campaign that channeled fear of Islam, and courted that same anxiety from the moment he arrived in office. The phrase “radical Islamic terrorism” was intoned again and again, from stump speeches to the halls of Congress itself. It was used as a cudgel against his predecessor and his opponent, a means of showing how much stronger he would be against America’s enemies. He taunted Democrats, jeering that they were afraid to use the phrase.

It was a phrase he loved to repeat. He accused Obama — and Hillary Clinton — of fearing to use it. He swore to keep the country safe from it. And he promised to use it as a litmus test for entrance to this country.

He kept at it even once in office.

There was enormous concern he would use the phrase in his speech in Saudi Arabia. The Obama administration had long insisted the phrase lumped an entire religion together, tarring billions of people with the sins of a minority, and would undermine our efforts to isolate radicalism.

Part of the restart with the Muslim world meant Trump’s team worked assiduously behind the scenes to strip “radical Islamic terrorism” from Trump’s collection of catch-phrases. National Security Adviser H.R. McMaster had been lobbying for the president to drop the expression for months now, agreeing with his predecessors that the phrase set up a dangerous dichotomy. But even McMaster wasn’t sure if it would show up anyway.

“I think what the president does, is he listens to people. … This is the president asking questions, listening, learning, and of course the president will call it whatever he wants to call it," McMaster told George Stephanopoulos on ABC’s This Week Sunday morning. "I think it’s important that whatever we call it, we recognize that these are not religious people, and in fact, these enemies of all civilization, what they want to do is to cloak their criminal behavior under this false idea of kind of a religious war."

McMaster was part of a team of Trump surrogates who spent the week before Trump arrived in Saudi Arabia attempting to calm concerns about the speech and the trip.

At a press conference last Tuesday, McMaster promised Trump would “deliver an inspiring but 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.”

Speaking with Vox on Friday, Shadi Hamid, senior fellow in the Project on US Relations with the Islamic World in the Center for Middle East Policy at the Brookings Institution, noted that McMaster’s “previews of the speech were a significant improvement over Trump campaign rhetoric.”

Hamid said that even by “including Islam as one of the world’s great religion and talking about a common civilizational front” was a “a more inclusive message” than we saw on the campaign.

That said, “the whole discourse around this is problematic,” Hamid added, noting that no president would hold forth on any other religion, so the idea of holding forth on Islam is peculiar, even potentially offensive ground. Even the presumption, he said, that “we know who is moderate” and a moderate Muslim becomes synonymous with someone who agrees with us on national security interests is “problematic because you are instrumentalizing Muslims for US security objectives.” It may be understandable, he said, but problematic nevertheless.

Hussein Rashid agrees, “There is a paternalistic attitude here that Trump can go and tell Muslims this is how you should go and practice our faith.”

The speechwriter was the author of the Muslim ban

McMaster’s goals were lofty, but expectations for the speech were relatively low. That’s partly because Stephen Miller, Trump’s wordsmith on this trip, was the same staffer who penned the Muslim ban.

Miller is well known to Islamophobia watchers. Even as an undergrad at Duke in the middle of the last decade, he espoused some of the thinking that would eventually make its way into the Trump speeches. Take one column he wrote back in 2006:

“Islamic terrorists have declared holy war on the United States,” he wrote in a piece titled “Unpatriotic Dissent.” “They have declared a death sentence on every man, woman and child living in this country. They are actively seeking, with the assistance of radical Muslim despots, weapons that would permit them to execute hundreds of thousands of Americans in a single attack.”

The following year he took the helm of a group called the Terrorism Awareness Project, funded by David Horowitz’s Freedom Center. Terrorism Awareness Project put out full-page campus ads advising “What Americans need to know about jihad.”

Saudi Arabia was already primed to like Trump

It was no surprise that Trump chose Riyadh for this speech. It’s not just because Saudi Arabia is home to Mecca and Medina, the holy cities of Islam.

It is also because the leadership of Saudi Arabia was already more in sync with Trump than they were with President Obama — on everything from his management style to his vision of the Middle East. For one, the Saudis were never pleased with Obama’s overtures to Iran. Trump has been vocal since the campaign that he disagreed with Obama’s Iran deal.

“They relate to Trump more because Trump has an authoritarian personality and these are authoritarian leaders,” says Shadi Hamid.

Obama had a penchant for lecturing the Saudis on human rights — even going so far as to delay an $110 billion arms sale that went through yesterday, out of concern for how those weapons might be used. Regional watchers said that Trump was not expected to lecture the Saudis on human rights.

“The good news for the Trump people is the Saudis want this to be a success,” said Bruce Riedel of the Brookings Intelligence Project on an advance call with journalists last week.

“They don't want any more talk about human rights, democracy, political reform, or gender equality. They had enough of that from Barack Obama and Hillary Clinton. They're pretty confident they're not going to hear it from Donald Trump, and I think they're pretty right about that.”