President Donald Trump and first lady Melania Trump on Wednesday made an unannounced visit to Iraq to meet with political and military personnel.

In his first visit to U.S. troops in a war zone since the start of his presidency, Trump defended his decision to withdraw American soldiers from Syria, and said that Patrick Shanahan, whom Trump elevated to acting Defense secretary starting in 2019, could hold the job "for a long time."

Air Force One left the U.S. overnight from Joint Base Andrews and landed at an airbase west of Baghdad on Wednesday evening. National security advisor John Bolton was also present.

The surprise trip was made "to visit with our troops and Senior Military leadership to thank them for their service, their success, and their sacrifice and to wish them a Merry Christmas," White House press secretary Sarah Huckabee Sanders said in a tweet.

Sanders tweet

Trump will reportedly also visit U.S. troops at Ramstein Air Base in Germany on his way back to Washington.

The president's trip comes on the heels of his sudden decision to withdraw American ground forces from Syria, which prompted Secretary of Defense James Mattis to hand in his resignation on Thursday. Mattis' departure was mourned by lawmakers of both parties who saw him as a stabilizing figure within the Trump administration.

Two days before he resigned, Mattis thanked U.S. troops at home and abroad for their service.

"This month, many in our military will be serving far from their loved ones. It is difficult work, but this is nothing new: since Washington crossed the Delaware on Christmas Day in 1776, American troops have missed holidays to defend our citizens' experiment in democracy," Mattis wrote in a holiday letter. "Far from home, you have earned the gratitude and respect of your fellow citizens and it remains my great privilege to serve alongside you. Merry Christmas and may God hold you safe."

Speaking to reporters in Iraq, Trump defended the decision to withdraw the nearly 2,000 troops, saying, "A lot of people are going to come around to my way of thinking."

In a tweet last week, Trump claimed that Islamic militant group ISIS had been "defeated" in the country.

But Trump said Wednesday that he has "no plans at all" to remove the more 5,000 U.S. troops currently in Iraq.