President Donald Trump's surprise trip to Iraq to visit US troops fell short among some political commentators, including one of the most highly decorated officers in the US Army.

Former Gen. Barry McCaffrey in an interview with MSNBC described Trump's visit as "embarrassing" and "entirely inappropriate."

McCaffrey said that what was supposed to be a morale-boosting visit between troops and the commander in chief instead became a political affair.

He also quoted a line from the sitcom "Seinfeld" in response to Trump's false claim that US troops received their first pay raise "in more than 10 years" under his administration.

President Donald Trump's surprise trip to Iraq to visit US troops, his first combat-zone visit as president, fell short among some political commentators, including one of the most highly decorated officers in the US Army.

Former four-star Gen. Barry McCaffrey, who was awarded three Purple Heart medals, two Distinguished Service Crosses, and two Silver Stars, described Trump's visit as "embarrassing" and "entirely inappropriate" in a Thursday interview with MSNBC.

McCaffrey told MSNBC that it was "a good thing that the president went to Iraq and visited the troops" but suggested that what was supposed to be a morale-boosting visit between troops and the commander in chief instead became a political affair.

During his trip, Trump signed pieces of campaign memorabilia for the troops, including hats emblazoned with the "Make America Great Again" campaign slogan. McCaffrey suggested the hats may have been distributed by Trump's campaign; however, the US Air Force and White House disputed that assertion on Thursday, calling the materials "personal items" that service members chose to bring on their own.

Read more: People have a lot to say about Trump signing MAGA hats for US troops in Iraq

But Trump's speech to the troops particularly struck a nerve with McCaffrey. Last week, Trump announced he would withdraw the roughly 2,000 US troops from Syria, citing the highly disputed claim that the Islamic State group had been "defeated." Following the backlash from many national-security experts, Trump suggested he was open to using Iraq as a staging point for another intervention in Syria, "if we wanted to do something."

McCaffrey also criticized Trump, who did not meet with Prime Minister Adil Abdul-Mahdi during the trip, for snubbing the leader of Iraq.

"The whole notion of going into Iraq and not genuflecting … the Iraqis is simply outrageous," McCaffrey said. "And announcing we're going to use it as the site from which we'll conduct combat operations in other nations, I mean, it's just inciting Iraqi sovereignty concerns.

He also criticized one of Trump's falsehoods about the military: the claim that US troops received their first pay raise "in more than 10 years" under his administration.

"It's not a lie if you believe it," McCaffrey said, quoting "Seinfeld" character George Costanza. "The troops all should have known it was complete nonsense, but they were sort of excited the commander in chief was there, and they were willing to blow by it."