(TNS) — Military service is for "suckers."

President Donald Trump defended his controversial military drawdown in Syria during a surprise trip to Iraq on Wednesday, telling American soldiers stationed in the war-torn country that the U.S. military is no longer the laughingstock of the world.

"We're no longer the suckers, folks," Trump told troops at the Al Asad Airbase in western Iraq while gushing about the genius of his military pullout in neighboring Syria. "We're respected again as a nation."

Thousands of American troops have been in Syria and Iraq for years as part of an international coalition to defeat the Islamic State terrorist group, also known as ISIS.

But Trump abruptly announced last week he's withdrawing all remaining forces from Syria because he claimed the group has been defeated _ even though some extremist militants remain in the country's eastern regions. The president's surprise withdrawal stunned his own national security advisers, drew bipartisan rebuke and resulted in Defense Secretary Jim Mattis and top envoy on the Islamic State Brett McGurk resigning in protest.

In what marks his first visit to a combat zone since taking office, Trump insisted to the soldiers in Iraq that the U.S. mission in Syria has been accomplished.

"I made it clear from the beginning that our mission in Syria was to strip ISIS of its military strongholds," said Trump, standing next to first lady Melania Trump. "Eight years ago, we went there for three months and we never left. Now we're doing it right and we're going to finish it off."

Trump assured the fatigue-clad soldiers he does not plan to reduce military involvement in Iraq, where more than 5,000 U.S. troops remain more than 15 years after the 2003 invasion.

However, expanding on his dislike for the U.S. presence in Syria, Trump took a broad swipe against military involvement at large.

"We are spread out all over the world. We are in countries most people haven't even heard about," Trump said. "Frankly, it's ridiculous."

When it comes to the future of Syria, Trump told soldiers that Turkish President Recep Tayyip Erdogan is committed to step in and take over the role the U.S. has played.

"The nations of the region must step up and take more responsibility for their future," Trump said, adding the withdrawal from Syria will be "strong" and "orderly."

Both Republicans and Democrats have scolded Trump for putting his trust in Erdogan, saying it poses a betrayal of U.S.-backed Kurdish forces in the region who will now be vulnerable to a Turkish military assault.

Critics from both sides of the aisle separately say the Syria scale-down plays right into the hands of Russia and the country's Kremlin-backed leader, Bashar Assad.

The unannounced Iraq visit was shrouded in secrecy for security purposes. Trump and his wife flew on Air Force One overnight from Washington, D.C., and touched ground at an airbase west of Baghdad Wednesday evening local time.

The trip came as a large swath of the federal government remained closed for a fifth straight day because of a congressional standoff over Trump's demand for billions of taxpayer dollars to construct a border wall with Mexico.

Trump was supposed to spend the holidays at his private Florida estate but scrapped those plans in light of the shutdown. The government closure could have been averted if Trump signed a spending bill passed with bipartisan support by the Senate, but he refused to, saying he won't approve any measure that doesn't put up at least $5 billion for a border barrier.

Trump has faced flak for not visiting U.S. troops in war zones during his first two years in office, which has been custom for previous presidents.

The commander in chief frequently boasts about his support for the military but has a convoluted relationship with the country's men and women in uniform.

As a presidential candidate, Trump trashed late Arizona Sen. John McCain _ who spent 5 { years as a prisoner of war in Vietnam _ because he said he prefers heroes "who weren't captured."

Trump also insulted the Gold Star parents of fallen Army Captain Humayun Khan after they spoke at the 2016 Democratic National Convention and, more recently, denounced Navy Adm. William McRaven as an "Obama backer" who should have killed Osama bin Laden faster after the official criticized the president for revoking the security clearance of former CIA Director John Brennan.

Some military and intelligence experts speculated Trump may have taken the Iraq trip for dubious reasons.

"If past is prologue, Trump will use this belated troop visit to deflect from the rhetorical bodyslam his own SecDef delivered to him and his worldview last week," former CIA officer Ned Price tweeted, referring to Mattis' blistering resignation letter. "The record shows Trump has consistently used our military as a prop for his personal and political advantage."