In a highly anticipated speech to dozens of leaders of Muslim countries in Saudi Arabia, Trump lashed out at Iran and softened his tone on Islam by rejecting the idea of a battle between religions.
He also avoided criticising his Saudi hosts and assembled leaders of Arab and Islamic nations on any human rights violations in their countries - a clear break from the practice of his predecessor Barack Obama.
"This is a battle between barbaric criminals who seek to obliterate human life, and decent people of all religions who seek to protect it. This is a battle between good and evil," Trump said.
His stance was later underlined by his secretary of state, Rex Tillerson, in a joint news conference with his Saudi counterpart.
"The president is clearly indicating that this fight of good against evil has nothing to do with religion. It has nothing to do with country. It has nothing to do with ethnicity," Tillerson said.
Trump's address was the centrepiece of his visit to Riyadh, which started on Saturday with the announcement of billions of dollars in trade deals with Saudi Arabia and continued Sunday with the speech and meetings with Arab leaders.
The visit is the first leg of an eight-day foreign tour -- Trump's first as president - that will take him on Monday to Israel and then the Palestinian territories and on to Europe.
'Drive them out!'
His speech sought to rally Islamic leaders behind a renewed push to tackle extremism, with Trump urging religious leaders to condemn violence and governments of Muslim countries to make further efforts to end support for extremists.
"Of course, there is still much work to be done. That means honestly confronting the crisis of Islamic extremism and the Islamists and Islamic terror of all kinds."
Advance excerpts of the speech had Trump using the term "Islamist terrorism" - an apparent softening in tone - but the president veered off-script in his delivery.
Trump appealed to Muslim nations to ensure that "terrorists find no sanctuary on their soil", and announced an agreement with Gulf states to combat financing for extremists.
"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!" Trump said.
The president made no mention of human rights during his visit, and in the speech insisted: "We are not here to lecture -- we are not here to tell other people how to live."
In another move sure to please his hosts, Trump accused Saudi Arabia's regional rival Shiite Iran of fuelling "the fires of sectarian conflict and terror".
"Until the Iranian regime is willing to be a partner for peace, all nations of conscience must work together to isolate it," Trump said.
Some 35 heads of state and government from Muslim-majority countries were in Riyadh for the Arab Islamic American Summit, mainly from Sunni states friendly to Saudi Arabia.
Iran 'spearhead of terrorism'
Introducing Trump, Saudi King Salman called Iran "the spearhead of global terrorism" and also vowed to "eliminate the Islamic State group".
Washington is leading a coalition battling IS, a Sunni Muslim jihadist organisation, in Syria and Iraq, and Trump said he would hold a press conference "in about two weeks" on how the US is faring in the battle.
Trump's speech was touted as a major event -- along the lines of a landmark address to the Islamic world by Obama in Cairo in 2009.
It was especially sensitive given tensions sparked by the Trump administration's attempted travel ban targeting several Muslim-majority nations and his previous remarks, including a 2015 statement that "Islam hates us".
Reacting to Trump's address, the Council on American Islamic Relations said "one speech cannot outweigh years of anti-Muslim rhetoric", and urged "concrete actions... to reset relations with the Muslim world".
Trump was welcomed warmly in Riyadh, where he and first lady Melania Trump were given an extravagant reception.
The first day saw the announcement of hundreds of billions of dollars in trade deals, welcome news for Trump as he faces mounting troubles at home.
Among the agreements was an arms deal worth almost $110 billion with Saudi Arabia, described as the largest in US history.
On Sunday he met Arab leaders including Egyptian President Abdel Fattah al-Sisi, Qatar's Emir Sheikh Tamim bin Hamad Al-Thani and Bahrain's King Hamad.
Warm talks with 'friend' Sisi
The meeting with Sisi - an avowed fan - was especially warm, and Trump said he would "absolutely" be putting Egypt on his list of countries to visit "very soon".
Trump called Sisi "my friend", and Sisi said the US president was "capable of doing the impossible", to which Trump responded: "I agree!"
Trump even complimented Sisi on his footwear, saying: "Love your shoes. Boy, those shoes. Man..."
Trump, who travels on Monday to Israel and the Palestinian territories before visiting the Vatican, Brussels and Italy for NATO and G7 meetings, is taking his first steps on the world stage as he faces increasing scandal at home.
The past week has included the announcement that James Comey, the former FBI chief fired by Trump, has agreed to testify publicly about Russian interference in the US elections.
Reports have also emerged that Trump called Comey "a nut job" and that the FBI has identified a senior White House official as a "significant person of interest" in its probe of Russian meddling.
(This story has not been edited by NDTV staff and is auto-generated from a syndicated feed.)
Follow NDTV for latest election news and live coverage of assembly elections 2019 in Maharashtra and Haryana.
Subscribe to our YouTube channel, like us on Facebook or follow us on Twitter and Instagram for latest news and live news updates.