WASHINGTON — A top adviser to President Trump on Saturday urged the defeat of a Michigan congressman and member of a conservative group of U.S. House lawmakers who derailed the White House on legislation to repeal and replace the Obama-era health care law.

But the tweet by White House social media director Dan Scavino Jr. violated federal law that limits political activity by government employees, government ethics lawyers said.

The White House had no immediate comment.

Two days after Trump himself tweeted a threat to the conservative House Freedom Caucus, a group of fellow Republicans, Scavino followed up Saturday by singling out Rep. Justin Amash, R-Mich., for criticism and urging Trump supporters to defeat the congressman in next year’s primary election.

“@realDonaldTrump is bringing auto plants & jobs back to Michigan. @justinamash is a big liability. #TrumpTrain, defeat him in primary,” Scavino tweeted.

Amash, who began serving his fourth House term in January, responded by retweeting Scavino and adding: “Trump admin & Establishment have merged into #Trumpstablishment. Same old agenda: Attack conservatives, libertarians & independent thinkers.”

Ethics lawyers who worked for both Republican and Democratic presidents said Scavino violated the Hatch Act, a federal law that limits political activity by government employees. They said it didn’t matter that Scavino tweeted from an account marked as “personal” and not from his official government Twitter account.