AL ASAD AIR BASE, Iraq (Reuters) - President Donald Trump made a surprise Christmas visit to U.S. troops in Iraq on Wednesday, his first trip to a conflict zone nearly two years into his presidency and days after announcing a pullout of American troops from neighboring Syria.

Trump was looking for some positive headlines after several days of turmoil over his decisions to withdraw the 2,000 U.S. troops in Syria, pull out half of the 14,000-strong contingent in Afghanistan, and push out Defense Secretary James Mattis two months earlier than planned for criticizing his policies.

Accompanied by first lady Melania Trump and speaking at the Al Asad Air Base west of Baghdad, Trump defended the withdrawal from Syria and said it was made possible by the defeat of Islamic State militants.

“Our presence in Syria was not open ended and it was never intended to be permanent,” he told troops wearing camouflage fatigues in a hangar at the base. He said some troops “can now return home to their families.”

Many Republican and Democratic lawmakers have heaped scorn on Trump over his Syria policy, saying the fight against Islamic State is far from over and the withdrawal leaves allies in the lurch.

One of those critics was Mattis, who said in a candid resignation letter last week that his views did not align with Trump’s, particularly on the treatment of U.S. allies.

Mattis had planned to leave at the end of February, but Trump forced him to go on Jan. 1 after his resignation letter was made public.

Trump has also drawn fire from some in the U.S. military for not having visited U.S. troops in conflict zones since taking office in January 2017, particularly after he canceled a trip to a World War One cemetery in France last month due to rain.

While there has been no full-scale violence in Iraq since Islamic State suffered a series of defeats last year, some 5,200 U.S. troops train and advise Iraqi forces still waging a campaign against the militant group.

Trump spent a little more than three hours in Iraq. On his way home, he stopped for about an hour and a half at Ramstein Air Base in Germany, where he shook hands and posed for pictures with some of the hundreds of troops lined up inside a hangar. After Ramstein, Trump headed back to Washington.

Trump was supposed to meet with Iraqi Prime Minister Adel Abdul Mahdi but in the end they only spoke by telephone.

Abdul Mahdi’s office said there was “a disagreement over how to conduct the meeting.” Iraqi lawmakers said the prime minister declined Trump’s request to meet him at the military base.

White House spokeswoman Sarah Sanders said the meeting could not be arranged due to security concerns and the short notice of the trip, but she said they had a “great call” and that Abdul Mahdi accepted Trump’s invitation to the White House in the New Year.

Slideshow ( 15 images )

“TOTAL VICTORY”

The unannounced visit in Iraq followed in the footsteps of two of Trump’s predecessors, Republican George W. Bush and Democrat Barack Obama, who both made surprise trips to see troops.

For security reasons, the visits are usually kept secret until after the president arrives. A small group of aides and Secret Service agents, and a pool of reporters, were with Trump and the first lady on the overnight flight from Washington.

Slideshow ( 15 images )

Trump said his main security concern was for the first lady.

While in Iraq, Trump also spoke to military commanders and the U.S. ambassador. Sanders said they “came up with a powerful plan that will allow us to continue our path to total victory” over Islamic State.

Unlike Syria, Trump said he had no plans to withdraw from Iraq.

Trump has had an uneven relationship with America’s military. He did not have to serve during the Vietnam War after being diagnosed with bone spurs in his heels.

As president-elect, Trump was drawn to the brawn of the armed forces and stacked his first Cabinet with generals, many of whom have since left his administration.

Trump has also wanted to end protracted U.S. involvement in overseas conflicts, and to force allies to pay more of the costs that he says fall disproportionately on American taxpayers, a point he made again on Wednesday.

Trump spoke to troops gathered in a dining hall festooned with holiday decorations and teased soldiers about their favorite football teams.

To reporters, he lamented the wear and tear of overseas conflicts.

“It’s time to get our young people out,” Trump said. “And I’ve been signing plenty of letters and I don’t like sending those letters home to parents saying that your young man or your young woman has been killed.

“I don’t like doing it. We’ve been doing it long enough.”