WASHINGTON (AP) — Republican Sen. Jeff Flake announced Tuesday he would not seek re-election next year, delivering a forceful condemnation of the "flagrant disregard of truth and decency" and bemoaning political complicity in a Senate speech clearly directed at President Donald Trump.

Speaking to a rapt audience of other senators, the first-term Arizona lawmaker spelled out his frustration and disappointment in a floor speech before relaying the news that he would not be on the ballot in 2018.

"There are times we must risk our careers," Flake said. "Now is such a time."

Flake, who has criticized the path 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 his remarks were unmistakably aimed at the president and his administration.

Flake, a former House member, is a conservative who favors limited government and free markets has been known to work on bipartisan legislation. Most notably, he joined Democrats and Republicans on legislation aimed at finding a path to citizenship for the 11 million immigrants living in the United States illegally.

"A political career does not mean much if we are complicit in undermining these values," he said. He received applause at the conclusion of his remarks, which mirrored the themes Flake detailed in his recent book, an anti-Trump manifesto titled "Conscience of a Conservative." The senator regretted his party's failure to stand up to Trump in last year's presidential race.

But Flake would have faced an uphill fight for re-election. GOP voters are in an anti-incumbent mood, heightened by the failure of Republicans in Washington to make good on seven years of promises to scrap President Barack Obama's health care law.

The senator's extraordinary speech came shortly after Trump had joined Senate Republicans at their weekly policy luncheon — and a few hours after the president had engaged in a war of words with another retiring Republican senator, Bob Corker of Tennessee.

As Flake spoke, Corker sat in the chamber next to Sen. John McCain, Arizona's six-term senator who's also tangled frequently with Trump. McCain called Flake "a man of integrity, and honor and decency" and said he stood up for what he believed in "knowing full well that there would be a political price to pay."

Republicans and Democrats said they were sorry to see Flake go.

"It is one of the most depressing things that has happened during my time in the Senate," said Sen. Michael Bennet, D-Colo., who worked closely with Flake on bipartisan immigration legislation.

Moderate Republican Sen. Susan Collins of Maine said she was "extraordinarily disappointed" and called Flake a "person of utmost integrity."

White House press secretary Sarah Huckabee Sanders said of Flake's speech, "A lot of the language, I didn't think, was befitting of the Senate floor."

After bucking Trump in a state the president won, Flake has been bottoming out in polls. Republicans may be left with a hard-core conservative challenger who 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 McCain last year but has gained some traction this year. Last week, former Trump strategist Steve Bannon attended a fundraiser for her.

Ward said in a statement, "Arizona voters are the big winner in Jeff Flake's decision to not seek re-election." She pledged to be "a strong conservative in the U.S. Senate who supports President Trump and the 'America First' agenda."

The PAC linked to Bannon crowed about a "monumental win" with Flake's retirement and called it "another warning shot to the failed Republican establishment that backed Flake and others like them that their time is up."

But mainstream Republicans in Arizona don't believe Ward can 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.

Sinema, meanwhile, made a fundraising pitch on Twitter, saying with Flake's retirement "we must do everything we can to show that we are ready to win #AZSEN. Chip in now." She raised more than $1 million in the quarter that ended Sept. 30, and has more than $4.1 million on hand.

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 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.

Herschel Fink, executive director of the Arizona Democratic Party, said Flake's retirement "further exposes the Republican Party's civil war — which will continue in full force in Arizona as the GOP struggles with a field of candidates who go further and further out of touch with voters."

Sen. Jeff Flake, R-Ariz., speaks during a television interview on Capitol Hill in Washington, Tuesday, Oct. 24, 2017. Flake announced 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" that is undermining American democracy. (AP Photo/Manuel Balce Ceneta)

WASHINGTON (AP) — Beto O'Rourke's "hell yes" moment at the Democrats' presidential debate is scrambling his party's message on guns.The Democrats have long contended their support of gun control laws does not mean they want to take away law-abiding citizens' firearms.

HOUSTON (AP) — The Latest on the Democratic presidential debate (all times local):9:55 p.m.Early front-runner Joe Biden took on the most fire at Thursday's Democratic presidential debate, and former Obama Housing Secretary Julián Castro was the most explicit in arguing it was time for a new generation.

WASHINGTON (AP) — And then there were 10.The Democratic Party's strongest presidential contenders — according to polls and fundraising, at least — meet on the same debate stage for the first time Thursday night.