Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

President Donald Trump vowed Thursday to "fight" lawmakers in his own party in the 2018 midterm elections, even calling out members of the conservative House Freedom Caucus by name who he sees as standing in the way of healthcare reform.

In a tweet, the president departed from platitudes about party unity and bipartisan outreach and instead retreated to his own corner, ready for battle against Democrats and some in the GOP.

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

Asked if the tweet meant the president was advocating for primary challenges to members of his own party, spokeswoman Sarah Huckabee Sanders told NBC News "the tweet speaks for itself."

Trump then took to twitter later in the day Thursday, targeting specific Freedom Caucus members Reps. Mark Meadows, Raul Labrador and Jim Jordan by name (and Twitter handle).

If @RepMarkMeadows, @Jim_Jordan and @Raul_Labrador would get on board we would have both great healthcare and massive tax cuts & reform. — Donald J. Trump (@realDonaldTrump) March 30, 2017

The president, who has 27 million followers, followed up the tweet with another that asked where Meadows, Jordan, and Labrador are and using the hashtags #RepealANDReplace and #Obamacare.

While some Freedom Caucus members were trolled on Twitter, Rep. Ken Buck — who admitted to paling around "with those liberty-loving Freedom Caucus guys" — was praised by the president for his oped in support of the failed American Healthcare Care Act, which House Speaker Paul Ryan and Trump had backed to replace Obamacare.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Trump's comment comes after his administration's defeat on a Republican attempt to overhaul healthcare last week. Despite repeated attempts to cajole House Freedom Caucus members to support the White House-backed cause to repeal and replace Obamacare, the bill never made it to a vote after it was clear it would fail on the floor.

President Donald Trump awaits the arrival of Iraqi Prime Minister Haider al-Abadi at the White House in Washington, Monday, March 20, 2017. Evan Vucci / AP, file

White House Press Secretary Sean Spicer told NBC News after the defeat that the takeaway from the experience was knowing who the White House could trust and work with, and who they couldn't.

"Some people you can take at their word," he said at the time.

Not only is it unusual for a president to take on his own party, but it runs counter to a new narrative from the White House that it's seeking bipartisan support on future legislative efforts.

Trump shared a rare evening of bipartisanship with senators and their spouses Tuesday evening at the White House, with Spicer telling reporters the president looked forward to the opportunity to "speak with some of the senators about the places where they can come together and make this country better."

Spicer specifically mentioned outreach to Democrats on confirming Supreme Court nominee Neil Gorsuch.

But Spicer also invited Democrats to join the administration as they plan tax reform and infrastructure overhauls. "We’d love to have as much support as possible," he said Tuesday briefing the press.

House Speaker Paul Ryan told reporters Thursday he understands and shares the president's frustration on the healthcare defeat.

"It's very understandable that the president is frustrated that we haven't gotten to where we need to go, because this is something we all said we would do," he said. "So he is just expressing his frustration, you all know he does that in various forms, including Twitter. And I understand his frustration."

During the campaign season, Trump bucked establishment Republicans and embraced a roiling style of campaigning that conflicted with Republicans, like Ryan. That style matches more closely with House Freedom Caucus members who now find themselves at odds with the sitting Republican president.

Less than one week ago, in the wake of defeat on healthcare, Trump called Freedom Caucus members "friends of mine" while expressing disappointment and surprise that the bill couldn't pass.

Rep. Justin Amash, R-Michigan, tweeted on Thursday that the president had been overtaken by the very swamp he once campaigned on draining.

It didn't take long for the swamp to drain @realDonaldTrump. No shame, Mr. President. Almost everyone succumbs to the D.C. Establishment. https://t.co/9bDo8yzH7I — Justin Amash (@justinamash) March 30, 2017

Asked later by NBC News if Trump's tweet was a constructive negotiating tactic with the caucus, Amash fired back that "it's constructive in fifth grade...it may allow a child to get his way, but that's not how our government works."

Rep. Ted Yoho, R-Florida, told MSNBC the tweet was "unfortunate" and said "we’re not fighting the president, we’re trying to honor what we ran on. 100 percent repeal of the Affordable Care Act. That’s what we’re going to stick to."

Rep. Dave Brat of Virginia told NBC News it's conservatives like those in the Freedom Caucus that have been with Trump all along.

"We all ran with the president," he said. "The never-Trumpers weren't with Trump. We're the clean the swamp guys, we're the let's listen to the American people guys, so he knows that."