Deputy White House press secretary Raj Shah was among six aides issued warning letters by the Office of Special Counsel after posting pro-Trump political messages. (Jabin Botsford/The Washington Post)

Six White House officials violated a federal law that prohibits public employees from conducting political activity in their official roles when they used their official Twitter accounts to send or display political messages supporting President Trump, according to the federal agency that enforces the law.

The announcement came the same day the Office of Special Counsel sought to clarify when federal employees could use words like “impeachment” or “resist” without running afoul of the 1939 Hatch Act — underscoring how political polarization in the Trump era has made the federal bureaucracy an increasingly fraught workplace.

The six White house employees, who included members of the press office, deleted their social media posts once they were told they had violated the Hatch Act, the Office of Special Counsel said. As a result, federal investigators issued warning letters rather than taking disciplinary action and advised that similar social media activity in the future would be considered a willful violation of the law that could result in further action, according to Erica S. Hamrick, deputy chief of the Hatch Act unit.

The White House officials who were reprimanded were principal deputy press secretary Raj Shah; deputy director of communications Jessica Ditto; Madeleine Westerhout, executive assistant to the president; Helen Aguirre Ferré, former director of media affairs; Alyssa Farah, press secretary for Vice President Pence; and Jacob Wood, deputy communications director for the Office of Management and Budget.

The White House did not respond to a request for comment.

All six had tweets or Twitter profiles that contained political messages, including the Trump campaign slogan “Make America Great Again” or the abbreviated hashtag #MAGA.

Because Trump is running for reelection, the Office of Special Counsel — a separate agency from the Justice Department special counsel’s office, which is leading the Russia investigation — prohibits federal employees from displaying Trump’s 2016 campaign images or using his slogan.

Earlier this week, the office drew criticism from some government watchdog groups when it issued guidance stating that advocating for or against the impeachment of federal officials is prohibited under the Hatch Act, whose purpose is to make sure the government is run in a nonpartisan fashion and to protect federal employees from political coercion.

In its guidance, the office also said that “to the extent that the statement relates to resistance to President Donald J. Trump, usage of the terms ‘resistance’ and ‘#resist’ and derivatives thereof is political activity.”

National Treasury Employees Union President Tony Reardon said in a statement Friday that the new guidance “could unnecessarily have a chilling effect on employees’ First Amendment free speech.”

“That prohibition has always been a fact-specific analysis in which the employee’s intent is relevant,” Reardon said. “This new guidance goes too far because it eliminates that critical factor.”

On Friday, Office of Special Counsel spokesman Zachary Kurz said that the guidance “was not intended to prevent all such discussions of impeachment in the federal workplace.”

Employees can discuss whether reported conduct by the president warrants impeachment and express an opinion about the news — but not display any materials that advocate for or against his impeachment, Kurz said.

Still, critics said public employees could be confused at best — and guilty of breaking the law in a worst-case scenario.

“Sadly, I don’t think it provides better understanding,” said Ward Morrow, assistant general counsel for the American Federation of Government Employees. “It’s more likely for people to throw out more complaints that there might be a Hatch Act violation for things they never even thought of before.”

In March, after Trump officially announced his reelection bid, the office issued guidance noting that the prohibition on political activity by federal employees is broad and goes beyond messages that “expressly advocate for or against President Trump’s reelection.”

The office said the ban also applies to displaying any items with Trump’s 2016 campaign materials.

“For example, while on duty or in the workplace, employees may not: wear, display, or distribute items with the slogan ‘Make America Great Again’ or any other materials from President Trump’s 2016 or 2020 campaigns; use hashtags such as #MAGA or #ResistTrump in social media posts or other forums; or display non-official pictures of President Trump,” the guidance said.

The warning letters issued Friday to the six White House officials came in response to complaints filed by the government watchdog group Citizens for Responsibility and Ethics in Washington (CREW).

The reprimands were the latest cases in which high-profile Trump administration officials have been found in violation of the Hatch Act.

Others sanctioned by the Office of Special Counsel for political messages include White House adviser Kellyanne Conway; Stephanie Grisham, the first lady’s spokeswoman; Dan Scavino, former White House social media director; and Nikki Haley, former U.S. ambassador to the United Nations.

The office found no violations by four other administration officials whose tweets were the subject of complaints by CREW, including White House press secretary Sarah Sanders and Office of Management and Budget Director Mick Mulvaney.

The agency is reviewing whether Interior Secretary Ryan Zinke violated the Hatch Act by tweeting a photo of himself sporting “Make America Great Again” socks from his official account June 26 before later deleting it.

The Office of Special Counsel provides the results of its investigations to complainants and does not typically make them public, so it is not clear how many senior officials were found in violation of the Hatch Act under previous administrations.

But under President Barack Obama, then-Labor Secretary Hilda Solis, then-Housing and Urban Development Secretary Julián Castro and Kathleen Sebelius, then Health and Human Services secretary, were reprimanded for violating the law.