Senator Bob Corker, Republican of Tennessee, last week in Washington.

WASHINGTON — President Trump on Sunday lashed out at Senator Bob Corker, the Tennessee Republican whose support will be critical to the White House on tax reform and the fate of the Iran nuclear deal, saying on Twitter that the senator had decided not to run for re-election because he “didn’t have the guts.”

“Senator Bob Corker ‘begged’ me to endorse him for re-election in Tennessee,” Mr. Trump wrote. “I said ‘NO’ and he dropped out (said he could not win without my endorsement).” Mr. Trump also said that Mr. Corker had asked to be secretary of state. “I said ‘NO THANKS,’” he wrote.

Mr. Corker shot back a barbed response. “It’s a shame the White House has become an adult day care center,” he wrote on Twitter. “Someone obviously missed their shift this morning.”

The president’s outburst amounted to an extraordinary public clash with a powerful, if lame-duck, Republican senator who holds sway over Mr. Trump’s domestic and foreign policy agenda. It also definitively ruptures what had been one of the few genuine relationships the president had developed with a Republican lawmaker on Capitol Hill.

As Washington digested this latest spectacle of a president feuding with a leader of his party, Mr. Corker’s camp said that Mr. Trump had mischaracterized his conversations with Mr. Corker. “The president called Senator Corker on Monday afternoon and asked him to reconsider his decision not to seek re-election and reaffirmed that he would have endorsed him, as he has said many times,” said Todd Womack, Mr. Corker’s chief of staff.

To some extent, however, the rift between the two men had been building for months, as Mr. Corker raised doubts about Mr. Trump’s character and fitness for office. Once a campaign supporter of the president, the senator has become openly derisive of his leadership.

After a report last week that Secretary of State Rex W. Tillerson had once referred to Mr. Trump as a “moron,” Mr. Corker told reporters at the Capitol that Mr. Tillerson was one of three officials helping to “separate our country from chaos.” Those remarks were repeated on “Fox News Sunday,” which may have prompted Mr. Trump’s outburst.

In August, after Mr. Trump’s equivocal response to the deadly clashes in Charlottesville, Va., Mr. Corker told reporters that the president “has not yet been able to demonstrate the stability nor some of the competence that he needs to demonstrate in order to be successful.”

Mr. Trump’s feud with Mr. Corker is particularly perilous given that the president has little margin for error as he tries to pass a landmark overhaul of the tax code — his best hope of producing a major legislative achievement in the coming months.

If Senate Democrats end up unified in opposition to the promised tax bill, Mr. Trump would be able to lose the support of only two of the…