Arizona Republican Jeff Flake will not pursue re-election after 2018, a decision he announced Tuesday in an impassioned Senate-floor speech targeted towards President Donald Trump.

Citing the president's "flagrant disregard of truth and decency," the Arizona senator said he will finish out his term before retiring in 2019.

"There are times when we must risk our careers in favor of our principles," Flake said. "Now is such a time.

"It is time for our complicity and our accommodation of the unacceptable to end."

Flake has been one of Trump's most vocal critics, declining to endorse him as a candidate for office and later speaking out against his administration's agenda -- most notably in a book criticizing Trump as insufficiently conservative.

Trump in turn has fired off a volley of attacks against the lawmaker, taking to Twitter to endorse Flake's primary challenger, call the Republican "toxic" and label the lawmaker "a non-factor in the Senate."

Though not mentioning the president by name, Flake made it clear he served as the impetus for his departure.

Reiterating points made in the past, he warned that the impulse "to threaten and scapegoat" could turn Americans into a "fearful, backward-looking people.

"It is often said that children are watching," Flake said on the floor. "They are. What are we going to do about that?

"Mr. President, I rise today to say, 'enough.'"

"If I have been critical, it not because I relish criticizing the behavior of the president of the United States," Flake continued. "If I have been critical, it is because I believe that it is my obligation to do so, as a matter of duty and conscience.

The notion that one should stay silent as the norms and values that keep America strong are undermined and as the alliances and agreements that ensure the stability of the entire world are routinely threatened by the level of thought that goes into 140 characters - the notion that one should say and do nothing in the face of such mercurial behavior is ahistoric and, I believe, profoundly misguided.

After Trump's speech, fellow Arizona GOP Sen. John McCain took to the floor to praise his colleague.

In an emotional address, he pointed to Flake's history of public service and voiced his conviction that Flake would continue in his career.

"I have seen Jeff Flake stand up for what he believes in, knowing full well there would be a price to pay," McCain said. "[Arizona] has never had a more deserving senator than Jeff Flake.

"One of the great privileges of my life has been the opportunity to know you and serve with you."

Flake was one of the most vulnerable Republican senators facing re-election.

Sagging in the polls, a September survey showed the lawmaker with just 25 percent favorability among Republican primary voters.

His likely opponent in that race would have been Kelli Ward, a conservative state senator endorsed by former White House strategist Steve Bannon.

Flake's announcement came the same day as Trump feuded with another prominent GOP senator, Sen. Bob Corker of Tennessee.

Corker has also announced his intention to retire after his current term.