President Donald Trump’s reelection campaign quietly took down an ad on Monday that may have skirted federal laws that govern politicking by active-duty U.S. servicemembers.

The 30-second video, which promoted the Trump administration’s accomplishments during its first 100 days, featured b-roll of the president shaking hands with his National Security Advisor, Lieutenant General H.R. McMaster , just after he accepted the job at Mar-a-Lago.

McMaster was wearing his Army uniform in the clip, and that may have violated the spirit if not the letter of Defense Department rules barring active-duty members of the military from participating in political advocacy in uniform.

By Monday afternoon, the Trump campaign had removed the ad and replaced it with a new version that did not include the McMaster clip. A campaign spokesman did not respond to a request for comment on the video.

Senior administration officials were not aware of the ad when contacted Monday morning, and asked for time to view it and check with their legal advisors. They declined to comment after the ad was taken down.

A senior defense official said the photo appeared to be from an official meeting, and therefore, “is not contrary to law and it does not violate any rules in policy.” The official spoke on condition of anonymity to describe the Pentagon’s legal policy on appearing in uniform at political events.

Still, the initial version of the ad “seems to violate [the] intent of military policy against members engaging in partisan political activity,” according to former Federal Election Commission general counsel Larry Noble.

Noble also runs the Campaign Legal Center (CLC), a watchdog group. Brendan Fischer, CLC’s director of federal programs, added that Pentagon rules “appear to prohibit McMaster from appearing in Trump’s campaign ad [in uniform], assuming he is still on active duty.”

Pentagon rules issued in 2005 prohibit the wearing of a military uniform “during or in connection with furthering political activities...when an inference of official sponsorship for the activity...may be drawn.”

Further guidance in 2008 instructed active-duty servicemembers to “refrain from participating in any political activity while in military uniform.”

Lt. Gen. McMaster is the third active-duty National Security Advisor in U.S. history. The last two were both appointed by President Ronald Reagan—Vice Admiral John Pointdexter and Lt. Gen. Colin Powell. Alexander Haig and Brent Scowcroft both served as the deputy national security advisor while still in uniform in the 1970s. Under President George W. Bush, Lt. Gen. Douglas Lute served as deputy national security advisor for Iraq and Afghanistan before retiring and remaining in the job as a civilian.

Though the Trump campaign’s video did not explicitly urge a vote for the president’s reelection, Trump is already a declared 2020 candidate. He officially filed his candidacy hours after his inauguration in January. His Republican and Democratic predecessors did not do so until more than two years into their first terms.

That early declaration of candidacy has imposed FEC reporting requirements that might not be required of the campaign absent Trump’s early official entry into the 2020 campaign.

This story was updated to add comment from a senior defense official and note non-comment from the administration.