ASSOCIATED PRESS Retired four-star Gen. Barry McCaffrey said of President Donald Trump’s comments during his Dec. 26 visit to U.S. troops in Iraq, “It was entirely inappropriate to use that as a point of a political rally.”

For the first time in his life, President Donald Trump visited service members in a combat zone and made it about himself, retired four-star Gen. Barry McCaffrey said.

Speaking to MSNBC’s Yasmin Vossoughian on Thursday, McCaffrey ― the recipient of two Silver Stars, two Distinguished Service Crosses and three Purple Hearts ― credited Trump for going to Iraq the day after Christmas but said he used it mostly as a political rally.

“It’s a good thing that the president went to Iraq and visited the troops, even better that he brought Melania along,” McCaffrey said. “It was entirely inappropriate to use that as a point of a political rally.”

During his visit, Trump signed “Make America great again” hats — a move McCaffrey called “unheard of.”

“His advance party politicized that event. They passed out those hats, for sure,” he said.

Trump boasted about how troops are getting a 10 percent pay raise. (They are not.)

“The troops all should’ve known it was all complete nonsense, but they were sort of excited the commander in chief was there and were willing to blow by it,” McCaffrey said of Trump’s lie.

The president also spoke to reporters about the dangers of his visit.

“If you would have seen what we had to go through in the darkened plane, with all windows closed, with no light anywhere,” Trump said. “Pitch black. I’ve been on many airplanes. All types and shapes and sizes. So did I have a concern? Yes, I had a concern.”

McCaffrey called the boast “embarrassing.”

“The president boasting about the dangers he’d faced, and [John] Bolton was a brave man to go with him. God, he’s talking to special operations soldiers in Iraq. It’s sort of embarrassing,” McCaffrey said.

He also slammed Trump for making no mention of the German troops currently helping the U.S.

“He flew back into Ramstein Air Base to refuel and to head home, made no gestures to the Germans, to [Chancellor] Angela Merkel,” he said. “We’ve got 30,000 troops in Germany. Forty percent of the Germans want us out of Germany, for God’s sake.”

Will Fischer, an Iraq War veteran with the liberal group VoteVets, said Trump visited the troops only after he felt pressured to. “Credit where credit is due — after two years, dozens of excuses and tons of public pressure, Donald Trump has finally visited Americans deployed to a combat zone,” Fischer said. “But, make no mistake, he had to be forced into doing what is right and what his job is.” CORRECTION: A previous version of this story was accompanied by a photo of Sen. Ben Cardin. Due to an editing error, it was also previously accompanied by a photo of Gen. Jim Mattis.