President Donald Trump made a surprise visit to American troops in Iraq on Wednesday, his first journey to an active combat zone since he took office.

The president, who was joined by first lady Melania Trump, spent three hours on the ground with U.S. forces and met with the U.S. ambassador and commanders on the ground.

A scheduled meeting with Iraqi prime minister Adil Abdul-Mahdi was scrapped. White House Press Secretary Sarah Huckabee Sanders said the meeting didn’t happen because due to security the invitation was made two hours in advance and the prime minister wasn’t able to get there in time, according to a pool report.

.@FLOTUS Melania and I were honored to visit our incredible troops at Al Asad Air Base in Iraq. GOD BLESS THE U.S.A.! pic.twitter.com/rDlhITDvm1 — Donald J. Trump (@realDonaldTrump) December 26, 2018

When the president entered the dining hall at the Al-Asad base west of Baghdad, about 100 service members present stood and clapped, according to reporters on the scene.

Later, in a hangar on base, the president and first lady greeted the troops: “We like to win. Do we like to win?” Trump said, to cheers.

In a speech to troops, Trump doubled down on his decision to withdraw troops from Syria and his longtime argument that America's military power is being exploited by other nations.

"America shouldn’t be doing the fighting for every nation on earth, not being reimbursed in many cases at all. If they want us to do the fighting, they also have to pay a price," Trump said. "And sometimes that’s also a monetary price, so we’re not the suckers of the world. We’re no longer the suckers, folks. And people aren’t looking at us as suckers."

The previously unannounced trip came at a time of change in the region following the president's announcement earlier this month that he will withdraw American troops from Syria — a heavily criticized move that prompted the resignation of Defense Secretary Jim Mattis.

Trump said on Wednesday that he had "no plans at all" to remove U.S. forces from Iraq, while defending his decision to pull them out of Syria.

"I think a lot of people are going to come around to my way of thinking. It's time for us to start using our head," Trump said.

PHOTOS: See President Donald Trump and first lady Melania Trump in Iraq

He said he had given "the generals" multiple six month extensions to conduct action in Syria. “They said again recently, 'Can we have more time?' I said, 'Nope. You can’t have any more time. You’ve had enough time. We’ve knocked them out. We’ve knocked them silly,'" he said, adding that Turkish leader Recep Tayyip Erdogan had said "he wants to knock out ISIS, whatever’s left, the remnants of ISIS."

"The United States cannot continue to be the policeman of the world," said Trump. "It’s not fair when the burden is all on us, the United States... We are spread out all over the world. We are in countries most people haven’t even heard about. Frankly, it’s ridiculous.”

Asked whether he'd had any concerns about making the trip, Trump responded that he had been worried about the institution of the presidency and first lady's safety, as well as the night timing.

He made the 11-hour flight on a darkened Air Force One with lights off and window shades were drawn, accompanied by military jet escorts. "If you would have see what we had to go through in the darkened plane with all window closed with no light anywhere. Pitch black," said Trump.

The president later landed at Ramstein Air Base in Germany, where he shook hands with troops, signed hats and posed for photos with servicemembers.

Before Wednesday's trip to Iraq, Trump had taken some heat from critics for being the first president since 2002 not to make a Christmastime visit to troops in 2018.

Troops cheer as President Donald Trump speaks at a hanger rally at Al Asad Air Base, Iraq, on Dec. 26, 2018. Andrew Harnik / AP

He was also criticized in November for canceling a trip to an American military burial ground outside Paris in November due to weather. Two days after that, he also skipped the traditional Veterans Day visit to Arlington National Cemetery.

The president said to Fox News’ Chris Wallace at the time that he should have gone to Arlington, adding that he hadn't visited a combat zone because he has "had an unbelievably busy schedule," adding, "I will be doing it."

In October, Trump told The Associated Press that he did not think it was "overly necessary" to visit a military base in a combat zone, such as Iraq and Afghanistan.

"I’ve been very busy with everything that’s taking place here," Trump said, referring to domestic issues. "But it’s something I’d do. And do gladly. Nobody has been better at the military."

At this point in their presidencies, President Barack Obama had visited troops in Iraq and Afghanistan, and President George W. Bush had visited Iraq just eight months after the start of the war in 2003.

Trump has often tried to distance himself from the wars in Iraq and Afghanistan, referring to them as failures of his predecessors and describing the missions in both countries as “a total shame,” according to The Washington Post.

President Donald Trump speaks at a hanger rally at Al Asad Air Base on Dec. 26, 2018. Trump defended his decision to withdraw U.S. forces from Syria, but said he has no plans to remove forces from Iraq. Andrew Harnik / AP

Trump’s own military service has been heavily scrutinized from the time he announced his candidacy. Trump reportedly received five draft deferments during the Vietnam War: Four for education, and one for having had bone spurs in his feet.

The New York Times on Wednesday reported that Trump’s diagnosis of bone spurs could have been given as a favor from Dr. Larry Braunstein, a foot doctor who rented a ground-floor office from the Trumps in Jamaica, Queens.

Braunstein died in 2007, but his daughters told the paper that their father frequently told the story of having helped Trump receive a military exemption during the Vietnam War in the 1960s.

Trump has said a "phenomenal" high draft lottery number ultimately that kept him from serving in the war. However, the Times noted that Trump had been medically exempted for more than a year before the lottery began in December 1969.