In his first high-stakes speech abroad, President Trump called on Middle Eastern nations to “drive out” extremists.

“The nations of the Middle East will have to decide what kind of future they want for themselves, for their country and, frankly, for their families and for their children,” Trump said to a roomful of leaders from more than 50 predominantly Muslim countries.

“It’s a choice between two futures, and it is a choice America cannot make for you. A better future is only possible if your nations drive out the terrorists and drive out the extremists. Drive them out. Drive them out of your places of worship. Drive them out of your communities. Drive them out of your holy land. And drive them out of this Earth,” he said.

The president’s speech at the Arab Islamic American Summit in Riyadh, Saudi Arabia, came on the second day of a trip that the administration sees as a chance to “start a new chapter in the history of the region,” as one senior administration official told ABC News.

Trump in his address took a far more measured tone on Islam than during the campaign, when he called for the “total and complete shutdown of Muslims entering the United States,” and said that he thinks “Islam hates us.”

Notably, he did not use the phrase “radical Islamic terrorism,” a term that has been a hallmark of his rhetoric at domestic events and which has drawn criticism abroad.

Instead Trump in his speech referred to what he called “the crisis of Islamist extremism and the Islamist terror groups it inspires.”

“This is not a battle between different faiths, 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,” Trump said. “This is a battle between good and evil.”

And, rather than painting Islam as an apparent enemy of the U.S., as Trump did during the presidential campaign, he depicted the Muslim world as an important partner in combating extremism.

He noted that while terrorism has taken the lives of innocent people in every corner of the world, Middle Eastern countries “have borne the brunt of the killings and the worst of the destruction in this wave of fanatical violence.”

“We are not here to lecture,” Trump said. “Instead, we are here to offer partnership — based on shared interests and values — to pursue a better future for us all.”

He encouraged Middle Eastern countries to join the U.S. in the fight against radical groups like ISIS.

“We can only overcome this evil if the forces of good are united and strong — and if everyone in this room does their fair share and fulfills their part of the burden. Terrorism has spread across the world. But the path to peace begins right here, on this ancient soil, in this sacred land,” the president said.

The president also called on religious leaders to take the lead to confronting extremism.

“Religious leaders must make this absolutely clear: Barbarism will deliver you no glory — piety to evil will bring you no dignity. If you choose the path of terror, your life will be empty, your life will be brief, and your soul will be condemned.”

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

The president worked on the speech during the 12-hour flight on Air Force One from Washington, D.C., to Riyadh with White House advisers including Stephen Miller, who played a key part in writing the president’s travel ban, which is now tied up in the courts.

On the president’s first day in Saudi Arabia, he met with the nation’s leaders and signed a new $110 billion arms agreement between the two nations.

“That was a tremendous day,” Trump told reporters. “Tremendous investments into the United States, and our military community is very happy.”

The president will also visit Israel and the Vatican during the trip which is taking place as controversies swirl in the U.S. around the investigation into potential ties between the Trump campaign and Russian officials in the 2016 election, which could take attention away from the overseas diplomatic initiative.