WASHINGTON (NYTIMES) - During his surprise visit to American troops in Iraq and Germany this week, President Donald Trump singled out red "Make America Great Again" caps in a sea of military fatigues, signed a "Trump 2020" patch and accused House of Representatives Democratic leader Nancy Pelosi and other leading Democrats of being weak on border security.
Now, the President is facing accusations that he was playing politics with the military.
"When that starts happening, it's like the politicisation of the judicial branch," said Mr Mark Hertling, a retired three-star army lieutenant-general.
Visiting troops abroad is a presidential tradition in which the commander-in-chief puts aside politics to thank a military that represents a broad spectrum of the country. But Mr Trump's political comments and his encouragement of supporters in the crowd veered from those norms.
"He has to understand that there exist some audiences that should not be addressed as part of his base, because they are not," Mr Hertling said. "It's a violation of protocol by the President."
Then there was the President's boast, which was incorrect, that the troops would be getting their first raise in more than a decade thanks to his leadership.
"You haven't gotten one in more than 10 years - more than 10 years," he told about 100 uniformed troops at Al Asad Air Base in Iraq. "And we got you a big one. I got you a big one." In fact, the military has received steady pay increases for decades.
Mr Trump also turned a customary Christmas greeting into a broadside against Democrats, who are refusing to fund a wall along the southern border. The stalemate over the wall, Mr Trump's signature campaign promise, has resulted in a partial government shutdown.
"I don't know if you folks are aware of what's happening," Mr Trump said. "We want to have strong borders in the United States. The Democrats don't want to let us have strong borders... You know why? Because I want it."
Mr Trump joked that his solution to obtaining funding for a wall was to claim that he did not want one anymore.
"Tell Nancy Pelosi I don't want the wall," he said, adding: "And then we get the wall. That's another way of doing it."
"You're fighting for borders in other countries, and they don't want to fight, the Democrats, for the border of our country," he added. "It doesn't make a lot of sense."
Ms Pelosi's deputy chief of staff, Mr Drew Hammill, accused Mr Trump of turning uniformed troops into scenery for a campaign speech. "He offered our brave men and women in uniform the bitter insult of using them as political pawns to push his radical right-wing, anti-immigrant agenda," Mr Hammill said. "The President turned his first visit to our troops into another cringeworthy Donald Trump reality-show special."
Some commentators on Fox News also criticised the President for injecting politics into the event. "He talked about the border wall as well, which didn't have a place there," Ms Julie Banderas, a Fox News contributor, said on the show Outnumbered.
Another Fox News contributor on the show, Ms Jessica Tarlov, criticised the President for using the visit "as a campaign rally".
The political paraphernalia on display, which Mr Trump appeared to encourage during his speech by referencing the caps he had signed, has raised questions at the Department of Defence (DOD) about violations of military protocol by the troops who greeted him.
One woman in uniform at Ramstein Air Base in Germany, for instance, welcomed Mr Trump with a "Make America Great Again" flag, according to a photograph posted on Twitter by a Bloomberg News reporter who accompanied the President on the trip.
A directive from the department prohibits active-duty personnel from engaging in "partisan political activities" and advises that "all military personnel should avoid the inference that their political activities imply or appear to imply DOD sponsorship, approval or endorsement of a political candidate, campaign or cause".
Defence Department and Army regulations also prohibit military personnel from showing any political leanings while in uniform, Mr Hertling said.
An official said the department was aware of the situation and "trying to figure it out" by tracking down photographs of troops holding red caps and campaign flags, and piecing together where the campaign paraphernalia came from.
Mr Trump said on Thursday that he could not turn down any requests from the soldiers. "If these brave young people ask me to sign their hat, I will sign," he tweeted. "Can you imagine my saying NO? We brought or gave NO hats as the Fake News first reported!"
White House press secretary Sarah Huckabee Sanders said administration officials did not distribute any campaign gear to the troops and noted that "these were their personal belongings".
On her Twitter feed, Ms Sanders addressed a CNN.com report that raised questions about whether the red caps displayed for Mr Trump to sign may have violated a military rule.
"CNN will attack anyone who supports President Trump, including the brave men and women of our military who fight every day to protect our freedom," Ms Sanders wrote. She declined to comment further on the President's speech.
In his remarks, Mr Trump also boasted that he had secured "billions and billions of dollars of new equipment" for the military. "You're getting such new equipment, your eyes are popping, right?" he asked the troops.