While visiting troops in Iraq, President Trump spent some time Wednesday signing his iconic “Make America Great Again” hats. As it turns out, that might have been a violation of Defense Department rules.

Troops are not supposed to be involved in political activities because the military is not a political force, CNN reports. Specifically, the policy states 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 hats and the MAGA slogan are symbols of Trump’s 2016 presidential campaign.

Reports suggest that many of the troops had brought their own hats to the event. Many of the reporters in attendance compared Trump’s appearance at the event to a campaign rally rather than a visit by a sitting President.

Trump’s visit was a surprise and marked Trump’s first visit to the combat zone. Trump recently announced plans to pull U.S troops out of Syria and 7,000 soldiers out of Afghanistan against the advice of military advisors. His Defense Secretary, Jim Mattis, stepped down a day later.

During his time in Iraq, Trump said he has no plans to remove troops from the area, stating “If we see something happening with ISIS that we don’t like, we can hit them so fast and so hard they really won’t know what the hell happened.”