US President Donald Trump has declared war on members of his own party by threatening the political careers of conservative Republicans who helped torpedo healthcare legislation he backed.

In a Twitter post, Trump took aim at the Freedom Caucus, a bloc of the most conservative Republicans in the US House of Representatives, indicating he would try to defeat them in next year’s congressional elections if they continued to defy him.

“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!” Trump said on Twitter.

Because Trump faces unified opposition by Democratic lawmakers, he cannot afford to lose many Republicans as he tries to get his legislative agenda through Congress, including healthcare, tax cuts and infrastructure spending.

Representative Justin Amash, a Freedom Caucus member from Michigan, shot back immediately at Trump in remarks outside the US Capitol.

“Most people don’t take well to being bullied,” Amash told reporters.

Asked if Trump’s comments were constructive, Amash added: “It’s constructive in fifth grade. It may allow a child to get his way, but that’s not how our government works.”

Since launching his presidential bid in 2015, Trump has shown little reluctance to assail fellow Republican political adversaries as well as Democrats, often in scathing terms.

Trump had previously accused Freedom Caucus members of snatching “defeat from the jaws of victory” with their opposition to Republican healthcare legislation he supported as he tried to replace Obamacare.

Trump went farther on Thursday, equating members of his own party with the Democrats, reflecting the extent to which he felt betrayed by the conservative lawmakers.

Republican House Speaker Paul Ryan said he understood Trump’s frustration.

The mistrust between the White House and hardline conservatives in Congress has called into question the next big item on Trump’s agenda, sweeping tax cuts.

Freedom Caucus members opposed the Trump-backed healthcare legislation in part because they said parts were too similar to the Obamacare law it was supposed to replace.