He also said that Arab nations had suffered the deadliest toll of "fanatical violence" and that there was a humanitarian and security disaster that was spreading in the region.
Trump, who generated controversy with his push to ban many Muslims from entering the United States, described the fight against terrorism as a battle between good and evil rather than a clash of civilizations.
"America is prepared to stand with you in pursuit of shared interests and common security. But nations of the Middle East cannot wait for American power to crush this enemy for them," Trump told leaders of 55 Muslim majority countries representing more than a billion people.
"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," he said.
"Its a choice between two futures and its 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.
"Terrorism has spread across the world. But the path to peace begins right here, on this ancient soil, in this sacred land," he said in Saudi Arabia, the first stop on a nine-day tour that includes Israel, Italy and Belgium.
The speech in a gilded hall bedecked with chandeliers is part of an effort to redefine his relationship with the Muslim world after Trump frequently attacked Muslims on the campaign trail last year and tried to ban many from entering the United States.
Trump received a warm welcome from Arab leaders, who set aside his campaign rhetoric about Muslims and focused on his desire to crack down on Irans influence in the region, a commitment they found wanting in Obama.(*)