In a surprise announcement, Sen. Jeff Flake (R-AZ) confirmed Tuesday that he will not run for reelection in 2018, citing the Republican Party’s changing tide toward President Donald Trump.

“None of these appalling features of our current politics should ever be regarded as normal,” Flake said in a fiery speech on the Senate floor just hours after Trump had left the Capitol. “We must never allow ourselves to lapse into thinking that is just the way things are now. If we simply become inured to this condition, thinking that it's just politics as usual, then heaven help us.”

“Reckless, outrageous, and undignified behavior has become excused as telling it like it is when it is actually just reckless, outrageous, and undignified,” he said, referencing President Trump. “And when such behavior emanates from the top of our government, it is something else. It is dangerous to a democracy.”

Flake’s remarks were met with a standing ovation from those in the room, including Sens. John McCain (R-AZ) and Bob Corker (R-TN), who have both made their fair share of biting comments about the president.

Senate Majority Leader Mitch McConnell thanked Flake for his service, calling him a “team player.”

The senator, who has been one of Trump’s most vocal critics — even penning a scathing critique of Trump in his book Conscience of a Conservative — told the Arizona Republic that “there may not be a place for a Republican like me in the current Republican climate or the current Republican Party.”

Flake was in a difficult position for 2018. Faced with an early challenge from far-right candidate Kelli Ward in the primary, he was already sinking in the polls.

Ward, a former state senator, has had Trump’s support over Twitter and has repeatedly attacked Flake from the right for being against the president and soft on immigration. She also supported Trump’s initial comments on the violent white supremacist rally in Charlottesville, Virginia, reiterating there was hate on “both sides.”

“Here’s the bottom line: The path that I would have to travel to get the Republican nomination is a path I’m not willing to take, and that I can’t in good conscience take,” Flake told the Arizona Republic in a telephone interview. “It would require me to believe in positions I don’t hold on such issues as trade and immigration and it would require me to condone behavior that I cannot condone.”

Flake’s announcement will put a big question mark over the 2018 Arizona Senate race. Though the state has a heavy conservative tradition, it also has a large Hispanic population that Democrats hope to fire up. And Trump’s increasingly low approval ratings certainly aren’t helping.

Trump has had it out for Flake for a long time

Trump’s inner circle has had it out for Flake for quite some time.

According to a July Politico report, White House officials met with “at least three actual or prospective primary challengers to Arizona Sen. Jeff Flake,” including Ward:

At a Republican National Committee meeting outside of San Diego in May, David Bossie, Trump’s deputy campaign manager and the president of the influential conservative outside group Citizens United, told Graham that either he or DeWit would likely get substantial backing from conservatives should either enter the contest, according to three people familiar with the conversation.

A second Politico report earlier in July alleged that Trump floated spending millions of dollars out of his own pocket to oust Flake, who has been openly critical of his presidency:

In private, Trump has spoken of spending $10 million out of his own pocket to defeat an incumbent senator of his own party, Jeff Flake of Arizona, according to two sources familiar with the conversation last fall.

Flake has vocally opposed Trump throughout his campaign and presidency. He refused to support Trump’s nomination, repeatedly expressed skepticism over Trump’s alleged ties with Russia, and dampened expectations on the Republican agenda, contradicting Trump’s desire for fast policy wins. He tweeted against Trump’s comments on Charlottesville.

Early on, Flake’s campaign said they were not worried about the possible primary challenges Trump could be negotiating with behind the scenes — but that sentiment clearly soured over time, to the point that the senator no longer felt he could run.

"This spell will pass, but not by next year," Flake told Arizona Central.