President Trump forcefully summoned the Muslim world to confront “the crisis of Islamic extremism” here Sunday on the eve of visits to Israel and the Vatican as he seeks to unite followers of disparate faiths against global terrorism.

Speaking from the birthplace of Islam, Trump implored the leaders of dozens of Muslim nations to take their destinies in hand and, together with the United States, eliminate the “wave of fanatical violence” committed in the name of religion.

“This is not a battle between different faiths, different sects or different civilizations,” Trump said in the first major foreign policy address of his presidency. “This is a battle between barbaric criminals who seek to obliterate human life, and decent people, all in the name of religion — people that want to protect life and want to protect their religion. This is a battle between good and evil.”

Trump implicitly rejected the aspirational goals and call for democracy and human rights of former president Barack Obama, who also delivered a major speech to the Islamic world early in his presidency. “We are adopting a principled realism,” Trump said.

“We are not here to lecture,” he said. “We are not here to tell other people how to live, what to do, who to be or how to worship. Instead, we are here to offer partnership, based on shared interests and values.”

1 of 60 Full Screen Autoplay Close Skip Ad × Photos of President Trump’s arrival in Saudi Arabia to begin his first foreign trip View Photos President Trump was received like visiting royalty in Saudi Arabia on the first leg of his maiden international trip, a five-stop marathon across the Middle East and Europe. Caption The U.S. president traveled to Saudi Arabia, Israel, Rome, Belgium and Sicily, Italy. May 27, 2017 German Chancellor Angela Merkel, left, speaks to President Donald Trump as Tunisia's President Beji Caid Essebsi listens during an expanded session at the Group of Seven Summit in Taormina, Italy. Philippe Wojazer/Reuters Buy Photo Wait 1 second to continue.

Trump called for unity in confronting Iran over its funding of terrorists and promotion of a “craven ideology.” He called on the Muslim world to help isolate Iran and, just days after Iranians reelected a moderate president, Hassan Rouhani, to “pray for the day when the Iranian people have the just and righteous government they so richly deserve.”

[Trump campaigned against Muslims but will preach tolerance in Saudi speech]

Trump was addressing a rare gathering of leaders of about 50 Muslim nations at the Arab Islamic American Summit.

It was the second day of a marathon foreign trip that will take Trump to Israel on Monday, where he is scheduled to meet with Prime Minister Benjamin Netanyahu and President Reuven Rivlin and visit the Church of the Holy Sepulchre and the Western Wall. On Tuesday, Trump will deliver a speech at the Israel Museum and briefly visit Bethlehem for a meeting with Palestinian Authority President Mahmoud Abbas.

Trump will then fly to Rome, where he will have a private audience with Pope Francis at the Vatican on Wednesday morning. He will attend a NATO summit in Brussels and a Group of Seven summit in Sicily, Italy, later in the week.

In the run-up to Trump’s visit here, there was speculation about whether he would utter the phrase “radical Islamic terrorism” in his speech, the centerpiece of his Saudi trip. On the campaign trail, Trump loudly criticized Obama for refusing to describe the terrorism threat in those terms. But some of Trump’s top aides, including national security adviser H.R. McMaster, have been urging him to soften his language. Many Muslim leaders consider broad denunciations of their faith insulting.

In his Riyadh address, Trump decided to use a substitute phrase: “Islamist extremism.” But he slightly veered off the prepared excerpts released earlier by the White House, saying “Islamic” instead of “Islamist” on several occasions.

President Trump shakes hands with Qatar's Emir Sheikh Tamim Bin Hamad Al-Thani, left, during a bilateral meeting on May 21, 2017, in Riyadh, Saudi Arabia. Seated with them are, from center to right, Secretary of State Rex Tillerson, White House senior adviser Jared Kushner and national security adviser H.R. McMaster. (Evan Vucci/AP)

[Read the full speech Trump delivered in Saudi Arabia]

Describing the fight against terrorism, Trump spoke of “honestly confronting the crisis of Islamic extremism and the Islamists and Islamic terror of all kinds.”

A senior White House official later said that Trump merely misspoke in using the word “Islamic” rather than “Islamist.”

“He’s just an exhausted guy,” said the official, who briefed reporters only on the condition of anonymity.

Lamenting the scourge of terrorism across the Middle East, Trump exhorted, “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.”

The Middle East, he said, had long been home to “Arabs and Christians and Jews living side by side” and could again be a place for “every person, no matter their faith.”

[Trump mocked Obama for bowing to a Saudi king. And then he …]

By preaching tolerance and calling Islam “one of the world’s great faiths,” Trump departed from his previously stated views on Muslims. Anti-Muslim rhetoric and policies were hallmarks of his nationalist presidential campaign; he proposed banning Muslims from entering the United States and proclaimed, “I think Islam hates us.”

Trump gave his remarks in an opulent hall of the King Abdul Aziz International Conference Center, where crystal chandeliers hung from the gilded ceiling and attendees sat in plush armchairs. The president was seated at the front of the room, behind an ornate wooden desk and alongside the summit’s host, King Salman, before taking the lectern.

No final list of the leaders in attendance was initially released. Seen chatting in the chamber and then listening intently were kings, presidents and prime ministers from Jordan, Pakistan and the Palestinian Authority, as well as Egypt and numerous other African states with Muslim majorities. Some, including Turkey and ­Sudan, sent lower-level officials.

Speaking before Trump, Salman appeared to be gently admonishing the United States for its strict visa policies, saying that all in the room rejected “profiling religions and countries on a religious or sectarian basis.”

But he was effusive in his praise of Trump and the president’s decision to make Saudi Arabia the first stop on his first overseas trip. Trump, he said, “has many hopes and aspirations with the Arab and Muslim worlds.”

Salman said that his kingdom is committed to “fighting all forms of terrorism” and that “one of the most important goals of Islamic sharia is protecting life, and there is no honor in committing murder.”

The king excoriated Iran, saying the Arab world had no problems with that country until its 1979 revolution brought a theocratic government that quickly turned to terrorism and regional ambitions. “These odious acts are the products of attempts to exploit Islam as a cover for political purposes to flame hatred, extremism, terrorism and religious and sectarian conflicts,” Salman said.

Trump was equally generous in his praise for Saudi Arabia, a Sunni Muslim state that considers Shiite Iran its principal rival for regional power.

He made proud reference to the $110 billion arms deal signed with the Saudis during his visit here and said the United States was willing to extend the same partnership to other nations that share its objectives.

Trump also highlighted, in terms reminiscent of his domestic boasting, what he said were the achievements of his first months in office, claiming the creation of nearly 1 million jobs.

[Ivanka Trump meets with Saudi women leaders as some activists remain critical]

The president wants to both profit from the sales and move partners in the Middle East to share more of what he has said is the unequal burden of defending against the Sunni terrorism of the Islamic State and al-Qaeda and against Iran.

“America is prepared to stand with you — in pursuit of shared interests and common security,” he said. “But the nations of the Middle East cannot wait for American power to crush this enemy for them. The nations of the Middle East will have to decide what kind of future they want for themselves, for their countries and, frankly, for their families and for their children.”

Overall, Trump delivered a dark decree to the leaders in attendance.

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

A few hours before his remarks, Trump and the leaders of six Persian Gulf states reached an agreement to crack down on terrorism financing, including the prosecution of individuals who send money to militants.

The memorandum of understanding between the United States and the Gulf Cooperation Council, comprising Saudi Arabia, Bahrain, Kuwait, Oman, Qatar and the United Arab Emirates, includes the creation of a center in Riyadh to fight extremism.

Dina Powell, Trump’s deputy national security adviser, called the agreement the “farthest-reaching commitment to not ­finance terrorist organizations” and said the Treasury Department would monitor it along with the gulf governments.

“The unique piece of it is that every single one of them are signatories on how they’re responsible and will actually prosecute the financing of terrorism, including individuals,” Powell told reporters.

[Trump signs ‘tremendous’ deals with Saudi Arabia on his first day overseas]

Outside funding for the Islamic State, al-Qaeda and other groups has come primarily from the Persian Gulf. U.S. officials in recent years have said that the gulf states have cracked down and virtually eliminated money coming from governments in the region. But they believe certain wealthy individuals — primarily in Kuwait and, to a lesser degree, Qatar — remain funnels for money or are themselves financing the groups.

A Kuwaiti cabinet minister was forced to resign in 2014 after the United States complained about his activities, and regional governments have instituted legal crackdowns, with varying degrees of success, to stem the practice. All have signed agreements in the past to stop it.

The Islamic State, in particular, has largely funded itself through extortion and taxes in the areas it controls in Syria and Iraq and through revenue for oil it sells clandestinely. But those sources, along with kidnapping for ransom, have diminished as the militants have lost territory.

The warm embrace of Trump that was on festive display on his first day in Riyadh continued during a trio of bilateral meetings the president held Sunday at the Ritz-Carlton hotel.

Egyptian President Abdel Fatah al-Sissi praised Trump and invited him to visit Egypt, which Trump said he intends to do. Through a translator, Sissi said, “You are a unique personality that is capable of doing the impossible.”

“I agree!” Trump replied, as his advisers and others looking on laughed.

Trump went on to compliment Sissi on his fashion, telling the Egyptian leader, “Love your shoes. Boy, those shoes. Man . . .”

Trump met with Sissi this spring in Washington, breaking an Obama-era ban on receiving the Egyptian leader in the White House because of his crackdowns on political and civil expression since taking power in a 2013 coup.

Trump called Sissi “my friend” and thanked him for his help with the release of American aid worker Aya Hijazi, 30, who had been imprisoned in Cairo.

[Freed Egyptian American prisoner returns home following Trump intervention]

Trump also met with the emir of Qatar, Sheikh Tamim Bin Hamad al-Thani, and noted the long friendship between the two countries and the prospects of future trade.

“One of the things that we will discuss is the purchase of lots of beautiful military equipment, because nobody makes it like the United States,” Trump told reporters ahead of his talks with the Qatari leader. “And for us that means jobs, and it also means, frankly, great security back here, which we want.”

Read more:

‘I think Islam hates us’: A timeline of Trump’s comments about Islam and Muslims

Trump’s first trip abroad: Everything that’s happened so far