CNN  — 

President Donald Trump made his first visit to a war zone on Wednesday, receiving an enthusiastic reception from many US troops there – some of whom may have run afoul of military rules.

Video footage and the written report of Trump’s visit with service members in Iraq showed the President signing “Make America Great Again” hats and an embroidered patch that read “Trump 2020.”

A US military official told CNN the MAGA hats that Trump signed at the Ramstein Air Base event in Germany were personal and brought there by military personnel in hopes of getting an autograph. The official contended that it was not a campaign event and that the hats were used as support for Trump, not as a statement of political support.

Although the event was not an official Trump re-election campaign event, the President did declare his candidacy for re-election in 2020 soon after his inauguration.

White House press secretary Sarah Sanders told CNN the hats were personal items brought by the troops in Iraq and Germany. Sanders said the White House did not distribute them.

Department of Defense guidelines say that “active duty personnel may not engage in partisan political activities and 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.”

The questions arose because the hats, emblazoned with the President’s signature political slogan, appeared to be brand new and because there are rules against military personnel participating in political activities while in uniform.

No policy violations have been brought to the military’s attention at this time, said Capt. Christopher Bowyer-Meeder, a spokesperson for the US Air Force, Europe. He added there is no rule against Airmen bringing personal items to be signed by the president.

The Defense Department guidelines have the same intent as mirror the Hatch Act restrictions on political activities for civilian federal officials. In the Trump Era, officials have deemed hashtags and hats potential rule violations. Earlier this year specific guidance notified federal employees that bringing MAGA hats to work or using the terms “#resist” or “resistance” in reference to President Trump could violate the Hatch Act.

Retired Rear Adm. John Kirby, a former Obama administration spokesperson and a CNN analyst, said on CNN’s “The Situation Room” on Wednesday that service members having Trump sign the items was inappropriate.

“It is in fact a campaign slogan, that is a campaign item, and it is completely inappropriate for the troops to do this,” Kirby said.

Kirby assigned some blame to Trump himself for political activity around the military: “Every time he’s around military audiences, he tends to politicize it, and he brings in complaints and grievances from outside the realm of military policy.”

CNN’s Ross Levitt, Sarah Westwood, Sophie Tatum and Barbara Starr contributed to this report.