Trump, making his first presidential visit to troops in a troubled region, said it's because the US military had all but eliminated IS-controlled territory in both Iraq and Syria that he made a decision to withdraw 2,000 forces from Syria.
"We've knocked them silly", said Trump, according to a pool report.
Trump and First Lady Melania also shook hands and posed for cellphone selfies with hundreds of uniformed service members at the base, some of whom waited to get his his autograph on their red "Make America Great Again" baseball caps, which helped define Trump's presidential campaign in 2016.
The US presence in Syria was not meant to be "open-ended", he said, adding that other wealthy nations should pay for rebuilding Syria.
US President Donald Trump speaks to members of the US military during an unannounced trip to Al Asad Air Base in Iraq
On his stop in Iraq, he defended his decision to pull out the 2,000 troops from Syria, which he has said was made possible by the defeat of ISIS militants.
While there has been no full-scale violence in Iraq since Daesh suffered a series of defeats past year, some 5,200 USA troops train and advise Iraqi forces still waging a campaign against the militant group.
"We're no longer the suckers, folks".
The president made his first trip to the combat zone with Melania to boost morale with United States troops.
"When I heard what you had to go through".
"You can't have any more time".
Trump also emphasised that his visit to the combat zone was to enable him to pay his respects to the "incredible troops" that the USA now has stationed in Iraq.
Trump has also wanted to end protracted United States involvement in overseas conflicts, and to force allies to pay more for the costs that he says fall disproportionately on American taxpayers, a point he made again on Wednesday.
"We'll always be there for Israel", he said.
In his typically forcefully-worded resignation letter, Mattis appeared to chide Trump when he stressed his own "strongly held" views on "treating allies with respect and also being clear-eyed about both malign actors and strategic competitors".
The decision to pull US forces from Syria, however, stunned national security advisers and USA allies and prompted the resignations of Defence Secretary Jim Mattis, who was not on the trip, and the US envoy to the coalition fighting the Islamic extremist group.
Fifteen years after the 2003 invasion, the U.S. still has more than 5,000 troops in Iraq supporting the government as it continues the fight against remaining pockets of resistance by the Islamic State (IS) group. "If I will say this, if you take ISIS and if we see something happening with ISIS that we don't like, we can hit them so fast and so hard, they won't, they really won't know what the hell happened", he said. "GOD BLESS THE U.S.A.!" said Trump on Twitter. "Yes I had a concern".
Next month marks the president's third year in office and he is now the third president to visit Iraq, alongside Barack Obama and George W. Bush. Vice President Pence visited Afghanistan on December 22, 2017, to address troops and meet with commanders at Bagram Airfield near Kabul. He said some troops "can now return home to their families".