Trump made his remarks to reporters after arriving with first lady Melania Trump about 7.16 pm local time at Al Asad airbase in western Iraq on his first trip as president to visit troops stationed overseas.
They travelled there unannounced "late on Christmas night" to thank troops for "their service, their success and their sacrifice", it said.
To begin with, Trump did not meet with a single Iraqi official, including Prime Minister Adel Abdul Mahdi.
Mattis was supposed to continue leading the Pentagon for several weeks, but Trump moved up his exit and announced that Patrick Shanahan, deputy defence secretary, would take the job on January 1 and he was in "no rush" to nominate a new defence chief.
Mr Trump and his first lady Melania Trump landed in an airbase west of Baghdad on Boxing Day night (local time) in an unannounced visit to greet USA soldiers, after an overnight flight from Washington.
"America shouldn't be doing the fighting for every nation on earth, ' Trump told troops, adding that the United States wouldn't be helping to rebuild Syria".
Addressing troops from inside a hangar at the al-Assad air base, where a contingent of British forces are also located, he said: "There will be a strong, deliberate, and orderly withdrawal of USA forces from Syria".
In explaining his decision to withdraw troops from Syria, Trump told reporters in Iraq on Wednesday that he had repeatedly directed "the generals" to get out of Syria, but that they asked for multiple six-month extensions.
A decade-and-a-half later, the US-led war on the false pretext of finding Iraq's weapons of mass destruction has killed hundreds of thousands of Iraqis and some 5,000 American troops without yielding any meaningful results.
US President Donald Trump speaks to members of the US military during an unannounced trip to Al Asad Air Base in Iraq
Morale-boosting presidential visits to United States troops in war zones have been a long-standing tradition in the years following the September 11 terrorist attacks.
"Because you have the right to have a Secretary of Defence whose views are better aligned with yours on these and other subjects, I believe it is right for me to step down from my position", the letter reads. "I said, 'Nope.' You can't have any more time".
WASHINGTON - US President Donald Trump on Wednesday dismissed Israeli concerns over his abrupt withdrawal of US troops from Syria. "We need safety for our country", he said. "They should be sharing the burden of costs and they're not", the US President said.
"Trump's visit is a flagrant and clear violation of diplomatic norms and shows his disdain and hostility in his dealings with the Iraqi government", said a statement from Bina. Mattis had planned to leave at the end of February but Trump forced him to go on January 1 after his resignation letter.
He suggested that he was not anxious about losing the ability to hit the IS, called ISIS by the administration, saying that "If we see something happening with ISIS that we don't like, we can hit them so fast and so hard they really won't know what the hell happened", Trump said, according to Bloomberg News.
"In fact we could use this as the base if we wanted to do something in Syria", he told troops at the Al Asad base.
"You know why? Because I want it".
It comes a week after Mr Trump stunned his national security advisers by announcing that he would withdraw USA troops from neighbouring Syria where they have been fighting Islamic State militants.
The president told Fox News' Chris Wallace at the time that he should have gone to Arlington, and he hasn't visited a combat zone because he has "had an unbelievably busy schedule", adding, "I will be doing it".
The US has kept a sustained military presence in Iraq since the 2003 invasion launched by former President George W Bush.
Social Media Abuzz After News of Cyrus-Hemsworth Marriage
The couple tied the knot in a small ceremony on Sunday, according to reports. "Miley seems ecstatic", the source says. Miley took to Instagram to confirm the date of their nuptials, simply captioning one of her posts: "12.23.18".
Mattis signs order to withdraw troops from Syria
Mattis followed the initial announcement up of his withdrawal with an announced plan to resign by the end of February. Defense officials have cautioned against a timeline but the withdrawal could begin in weeks.
Zero Weekend Box Office | Shah Rukh Khan | Anand L. Rai | #TutejaTalks
Trade sources pegged the opening day figures at Rs 18.50 crore and the collection by Sunday evening at Rs 51.75 crore. Swara, who worked with the director in films like "Raanjhanaa" and "Tanu Weds Manu", "loved every second of "Zero" .