President Trump's social media director violated federal law restricting government officials' political activity when he called for the defeat of a GOP congressman in a tweet, the Office of Special Counsel (OSC) has concluded.

White House Director of Social Media Dan Scavino, Jr., "violated the Hatch Act" when he called for Rep. Justin Amash (R-Mich.) to be defeated in a primary in an April 1 tweet, OSC said in a June 5 letter to Citizens for Responsibility and Ethics in Washington (CREW). The nonprofit organization had asked OSC -- an independent investigative and prosecutorial government office -- to look into whether Scavino's tweet constituted a violation of the Hatch Act.

"OSC has concluded that this activity violated the Hatch Act," OSC's Ana Galindo-Marrone, chief of the office's Hatch Act Unit, said in the letter to CREW's chief counsel, Adam Rappaport. "Accordingly, we issued Mr. Scavino a warning letter. In addition, we note that Mr. Scavino was recently counseled about the Hatch Act by the Office of the White House Counsel. A review of Mr. Scavino's personal Twitter account since that time did not reveal any new violations."

Get Breaking News Delivered to Your Inbox

The letter also said OSC advised Scavino further punishment could be headed his way, "if in the future he engages in prohibited political activity while employed in a position covered by the Hatch Act."

Scavino lashed out against Amash after the outspoken founding member of the House Freedom Caucus criticized Mr. Trump's foundering health care plan. The vote for the administration's initial health care plan was canceled after it failed to receive enough GOP support.

.@realDonaldTrump is bringing auto plants & jobs back to Michigan. @justinamash is a big liability.#TrumpTrain, defeat him in primary. — Dan Scavino Jr. (@DanScavino) April 1, 2017

Mr. Trump also lashed out against the House Freedom Caucus in general after his initial health care defeat, saying, "we must fight" them in the 2018 midterms.

The Freedom Caucus will hurt the entire Republican agenda if they don't get on the team, & fast. We must fight them, & Dems, in 2018! — Donald J. Trump (@realDonaldTrump) March 30, 2017

The Hatch Act prohibits most government employees from engaging in some forms of political activity, like promoting specific candidates or campaigning against them. Obama-era officials also violated the Hatch Act, according to OSC. One such example was former HUD Secretary Julian Castro, who promoted former presidential candidate Hillary Clinton in an April 4, 2016, interview with Yahoo News. OSC also found him responsible for violating the Hatch Act.

There is a range of penalties for those who violate the Hatch Act, according to the Office of Government Ethics, which says that an employee in violation of the Act "shall be subject to removal, reduction in grade, debarment from Federal employment for a period not to exceed 5 years, suspension, reprimand, or an assessment of a civil penalty not to exceed $1,000."