Senator Jeff Flake, an Arizona Republican, announced Tuesday he would not run for re-election in 2018, condemning in a speech aimed at President Donald Trump the "flagrant disregard of truth and decency" Flake says is "undermining American democracy."

"There are times we must risk our careers," Flake said in a speech on the Senate floor. "Now is such a time."

RELATED: Trump dismisses criticism of Corker and Flake

Flake, who has criticized the path that the Republican Party has taken under Trump, said the impulse "to threaten and scapegoat" could turn America and the GOP into a "fearful, backward-looking people" and a "fearful, backward-looking party." Flake didn't mention Trump by name, but clearly was directing his remarks at the president and his administration.

Watch the raw video of Flake's speech on the floor of the Senate in the video player above.

It’s been one of the great honors of my life to serve w/ @JeffFlake– a man of integrity, honor, decency & commitment to Arizona & the nation pic.twitter.com/DOHAoHx0d2 — John McCain (@SenJohnMcCain) October 24, 2017

Arizona voters are the big winner in @JeffFlake's decision to not seek reelection. They deserve a strong, conservative in the Senate 1/2 — Dr. Kelli Ward (@kelliwardaz) October 24, 2017

Who supports @POTUS & the 'America First' agenda. Our campaign proudly offers an optimistic path forward for Arizona & America #MAGA 2/2 — Dr. Kelli Ward (@kelliwardaz) October 24, 2017

Thank you, @JeffFlake, for your service to Arizona. Full statement below: pic.twitter.com/ZoyU88IOY4 — Doug Ducey (@dougducey) October 24, 2017

Thank you to my dear friend @JeffFlake for your honorable service to the state of #Arizona & the nation. — John McCain (@SenJohnMcCain) October 24, 2017

Flake is a conservative who favors limited government and free markets. "A political career does not mean much if we are complicit in undermining these values," he said. His extraordinary speech came shortly after Trump had joined Senate Republicans at their weekly policy luncheon, and came a few hours after the president had engaged in a war of words with another retiring Republican senator, Bob Corker of Tennessee.

"Flake was the number one critic from the Republican Party saying he [President Donald Trump] would be the end of us, and he won," OH Predictive Insights pollster Mike Noble said. "You have roughly 80% of Republicans support the president, so what does that say about Jeff Flake?"

"He's going to hold to those ideas and principles that he thinks should be governing the GOP, and that takes a lot of courage," said Bettina Nava, a political consultant who used to work for Sen. John McCain.

After bucking Trump in a state the president won, Flake is bottoming out in polls. Republicans may be left with a hard-core conservative challenger that might win the primary but lose in the general election.

Flake was facing a challenge from former state Sen. Kelli Ward, who failed in her effort to take out Sen. John McCain last year but has gained some traction this year. Last week, former Trump strategist Steve Bannon attended a fundraiser for her.

But mainstream Republicans in Arizona believe Ward cannot beat Rep. Krysten Sinema, who is running in her primary as the only well-known Democratic candidate. They've been searching for another candidate to take on Flake, and his decision to step aside opens the door wide for those efforts.

Sinema released the following statement Tuesday afternoon, "It's been an honor to know and serve with Jeff. He is a man of integrity and a statesman who is true to his convictions - an Arizonan through and through. I wish he and Cheryl and their family the very best."

Besides Ward, other potential candidates for Flake's seat include current state university regent Jay Heiler, former state GOP chairman Robert Graham and state Treasurer and 2016 Trump campaign CFO Jeff DeWit. Other names that have been floated in recent weeks include Reps. Paul Gosar and Trent Franks, conservative stalwarts who sit in safe GOP seats.

Heiler announced early this month that he was considering a run. He was chief of staff to Arizona Gov. Fife Symington in the 1990s and has been involved in numerous political campaigns.

Former Gov. Jan Brewer was pushing Heiler as a candidate.

"I've known Jeff for a long time and I admire him for his service that he has given to our state," she said Friday.

"But I believe it is an opportunity for me to support a different candidate, someone that I've known for a long while, and somebody that I believe will serve Arizona the best."

With @JeffFlake announcement that he won’t run for re-election, the 2018 Senate race about to get real interesting! — Jan Brewer (@GovBrewer) October 24, 2017

Flake has not said what he will do after leaving the Senate.

"I'd be looking out for him at some kind of think tank that helps push public policy," said Nava, the political consultant. "I think that that would probably be a good fit for someone with his ideas on commerce, free trade, immigration."