A day after President Trump’s surprise visit to American forces in Iraq and Germany, questions persisted about whether he had jeopardized the political neutrality of the U.S. military by leveling partisan attacks and signing red “Make America Great Again” hats for the troops.

The president’s behavior — out of step with that of his predecessors — highlighted the struggle Pentagon leaders face in navigating an avowedly apolitical military through a hyperpartisan era in U.S. politics, particularly under a commander in chief unafraid of breaking with established norms. 

The struggle is likely to intensify with the beginning of the 2020 presidential campaign and the departure of Defense Secretary Jim Mattis, who sought to prevent the military from becoming a pawn in the nation’s tribal politics, at times unsuccessfully, before his resignation last week.

Trump defended his conduct late Thursday. “CNN & others within the Fake News Universe were going wild about my signing MAGA hats for our military in Iraq and Germany,” he wrote on Twitter. “If these brave young people ask me to sign their hat, I will sign. Can you imagine my saying NO? We brought or gave NO hats as the Fake News first reported!”

Critics also focused on the content of Trump’s speeches during his trip. By making overtly political remarks to uniformed troops who were excited to meet their commander in chief, Trump risked the American public seeing the military as a partisan fan base, the critics said, an image that may play well to his base but undermines the trust all Americans put in their armed forces.

“As long as the message from the president is how wonderful it is that they are doing a service for the country, that’s great,” said Charles Blanchard, a former general counsel for the Army and the Air Force during the Clinton and Obama administrations. “But when it turns into a political rally, what do people see? They see enthusiastic soldiers clapping and yelling for a partisan message.” 

The risk, Blanchard and other experts said, is an erosion of public faith in a military that 74 percent of Americans expressed confidence in during a 2018 Gallup poll, making it by far the most trusted government institution in American public life. One of the ways the military historically has earned that trust is by steering clear of politics and assuring Americans that uniformed officers will carry out the lawful orders of whatever civilian leadership the country elects without bias. 

Robert Dallek, a presidential historian, said there’s always an element of politics when presidents visit troops overseas but that Trump transgressed the line. 

“Lyndon Johnson went to Vietnam and visited the troops,” Dallek said. “Did he attack the Republicans? Did he attack his Democratic critics? No. It’s inappropriate. But, once again, what you have with Trump is someone who bends the rules and violates the norms in order to make himself look special or exceptional.”

The reason for the norms, according to Rosa Brooks, a law professor and national security expert at Georgetown University, is to ensure that an institution endowed by the American public with tremendous power “isn’t being used for partisan ends.” 

“We have the line because we don’t want to turn into a banana republic,” she said, noting that she was less worried about a handful of troops meeting the president and forgetting their training and more concerned about Trump “using an address to military personnel as a partisan opportunity.”

Trump’s trip began like any other commander in chief’s holiday visit to a conflict zone. He jetted into Iraq without warning, accompanied by first lady Melania Trump, and planned to deliver a rousing show of support to thank the forces for their service.

While the president cheered troops with his visit to Iraq, thanking them for their sacrifices and wishing them a merry Christmas, he otherwise approached his appearance much as he would a political rally or event. 

Speaking onstage at al-Asad Air Base in front of camouflage netting and a giant American flag, the president sported a military-style bomber jacket and alternated between political talking points and musings on foreign policy in between expressing appreciation and gratitude.

He even imported the traditional stagecraft of his political rallies to Iraq, entering to the tune of Lee Greenwood’s “God Bless the U.S.A.” and exiting to a rendition of the Rolling Stones’ “You Can’t Always Get What You Want.”

During his remarks, Trump attacked House Minority Leader Nancy Pelosi by name, saying the only way he could get the California Democrat to support a wall on the U.S. border with Mexico was to say he no longer wanted one. He told the troops that Democrats oppose strong borders and defense spending increases that help take care of the military. At an earlier news conference on base, he said that “we have a problem with the Democrats because Nancy Pelosi is calling the shots.”  

In another departure from traditional decorum, Trump questioned the judgment of the chain of command above the forces he met in Iraq, saying he had demanded a withdrawal from neighboring Syria but kept receiving requests from “our generals” to remain there for six more months. Finally, he suggested, he became fed up and told them “we’re doing it a different way,” suggesting the officers were wrong.

During a visit to the base’s dining facility, Trump signed several “Make America Great Again” hats that service members had brought with them and also signed a patch for one service member that read “Trump 2020.”

At Ramstein Air Base in Germany, where the president stopped on the way home, photographs posted by a Bloomberg News reporter to social media showed uniformed troops holding the red hats and one officer carrying a Trump campaign banner. 

The Pentagon declined to say whether those activities amounted to a violation of military rules requiring active-duty troops to stay apolitical, referring the query to local units. U.S. Air Forces Europe, in a statement to Stars and Stripes, said those who brought the MAGA hats didn’t violate rules because “there is no rule against airmen bringing personal items to be signed by the president.”

The rules are set out in Defense Department Directive 1344.10 and emphasized in training with American service members. The directive, among other things, prohibits active-duty service members from participating in political rallies, giving the appearance of endorsing a candidate or even displaying partisan political signs, posters and banners on a private vehicle or one’s residence on a military installation.  

The directive “outlines permissible and prohibited activities regarding political campaigns,” the Pentagon said in a statement.

The visit to Iraq and Germany wasn’t the first time that Trump faced criticism for politicizing the U.S. military. In his first days in office, he signed a travel ban on people from predominantly Muslim nations in the Pentagon’s Hall of Heroes, a choice of venue that made it seem as though the policy decision carried the military’s imprimatur.

Last year, in a commissioning ceremony for the USS Gerald Ford, Trump asked a crowd that included uniformed naval officers to call Congress and advocate both increased defense spending and his policy on health care.  

Since the campaign, Trump has viewed the military’s rank and file as his base. “We had a wonderful election, didn’t we?” he said at MacDill Air Force Base in Tampa in February 2017. “And I saw those numbers, and you liked me, and I liked you.”

Critics and retired military officers described president’s decision to deploy thousands of active-duty troops to the border with Mexico ahead of the midterm elections as a political stunt, even as Mattis defended the move as good training for the troops. 

Top officials in the military regularly telegraph the need for political neutrality, traditionally delivering the message around elections.

In mid-2016, for example, the chairman of the Joint Chiefs of Staff, Gen. Joseph F. Dunford Jr., wrote an article in Joint Force Quarterly explaining that while U.S. forces retain the right to vote and engage in policy issues, they must guard against allowing the military to become politicized and must “protect the integrity and political neutrality of our military profession.”

 Political strategists said Trump undercut the positive decision to visit the troops in Iraq with the politicking bravado he brought to his appearances at the base. 

“It’s important to the troops and morale that the commander in chief was willing to go out and see it with his own eyes,” said Rick Tyler, a Republican strategist. “But he diminished himself and the office by using it as an opportunity to politicize.” 

The advantage Trump has over his political rivals, Tyler said, is that he is commander in chief and carries the respect of the office. 

“You merely have to act the role,” Tyler said, “and you get all the political advantages without politicizing it.” 

Clarification: This story has been updated to specify that active-duty service members are prohibited from displaying partisan political signs, posters and banners on one’s residence “on a military installation.”