When President Trump, recovering from the novel coronavirus, welcomed hundreds of people on Saturday to what resembled a campaign rally on the White House grounds, the guests filed onto the South Lawn past a military band in resplendent red, its horns blasting the tune “America” from “West Side Story.”

The use of the United States Marine Band for a de facto political rally, where guests donned “Make America Great Again” hats and “Blexit” T-shirts — backing a movement that urges Black Americans to exit the Democratic Party — marked another instance of the president pushing the boundaries of U.S. law and the military tradition of political neutrality.

The band has played at every presidential inauguration since 1801, when President Thomas Jefferson gave the group the title “The President’s Own,” according to its online history. The band is called upon when the president is discharging his duties as head of state.

But federal regulations bar the use of government resources for, and the coercion of federal employees into, political activities aimed at a candidate’s reelection — and taxpayer-funded military bands cannot be used for campaign events. Members of the U.S. military are prohibited from wearing military uniforms at political campaign events.

Administration and military officials said the activity on Saturday was an official White House event called, “Peaceful Protest for Law and Order.”

“The United States Marine Band provided musical support for the Peaceful Protest for Law and Order event, an official event on the South Lawn of the White House,” Capt. Joseph Butterfield, a spokesman for the Marine Corps, said in a statement. “All tasking for U.S. Marine Band support at the White House, including for this event, is generated by the White House Military Office.”

Judd Deere, a spokesman for the White House, said: “The event yesterday was an official White House event and was conducted in compliance with the Hatch Act.” The Hatch Act bars federal employees from using their titles and positions to engage in political activity. The president and vice president are exempt but do fall under criminal provisions that prohibit the coercion of federal government employees to engage in political activity.

Defense Secretary Mark T. Esper and his predecessor, retired Marine Corps general Jim Mattis, have sought to protect the military from overtly partisan activity. But their efforts have been challenged by a president who has shown a willingness to defy civil-military norms respected by his predecessors, beginning with his first official visit to the Pentagon, when he used the Hall of Heroes to sign a ban on travel from majority-Muslim nations.

In the years since, Trump has treated troop talks and Pentagon appearances like campaign rallies, intervened in military justice cases and signed “Make America Great Again” paraphernalia on official presidential visits to military facilities overseas. He deployed active-duty forces to the southern border with Mexico before the 2018 midterm elections, taking heat for using the military as a political prop.

On Saturday, the Marine Band provided the musical backdrop as a crowd gathered under the South Portico of the White House, where Trump gave remarks from the balcony due to his coronavirus infection. Despite being billed as a non-campaign event, Trump began his talk by calling on the guests to vote his opponents “into oblivion” and attacked his Democratic opponent, former vice president Joe Biden.

Trump’s rallies regularly make use of show tunes, including from “Phantom of the Opera.” Saturday’s event was no exception. One “Blexit” supporter posted a video on Instagram beaming with excitement as the Marine Band played “America” from “West Side Story.”

“We are here at the White House, guys. Look!” the supporter said. “Isn’t it an amazing feeling?”

Alice Hunt Friend, a senior fellow at the Center for Strategic and International Studies, said mixing the military and partisan political activity is a “big violation” of civil-military norms.

“Americans who see uniformed military personnel at partisan political functions may assume the military has a partisan identity,” Friend said. “Presidents running for reelection always have to take extra care to keep their military aides out of their campaign activities.”

According to the U.S. Government Accountability Office, the U.S. military had 6,656 military personnel dedicated to bands as of 2016.

The Marine Band is one of the oldest and most elite. The band accompanied Abraham Lincoln to Gettysburg and for 12 years counted John Philip Sousa as its leader. It played the “Battle Hymn of the Republic” in a steady rain on the White House lawn for Franklin D. Roosevelt and Winston Churchill during World War II and later led the funeral procession for John F. Kennedy.

This summer, owing to the coronavirus pandemic, Trump moved the Republican National Convention to the South Lawn of the White House, holding speeches in between two giant “Trump Pence” campaign signs.

Walter Shaub, the former director of the U.S. Office of Government Ethics and a frequent critic of the president, called the use of the White House as a backdrop for a political convention an “abomination” that “may be the most visible misuse of official position for private gain in America’s history.”