Mr. Ryan’s comments appeared almost to be designed to elicit a rejoinder from a reactive president, and Mr. Trump dutifully engaged, calling Mr. Ryan a politician who was “not a talent,” “unable to raise money” or get subpoenas, “when Nancy Pelosi hands them out like they’re cookies.”

Mr. Trump, always sensitive to the idea of former political allies making money off their onetime association with him, also implied that Mr. Ryan was getting paid for talking to Mr. Alberta and said that “the only success Paul Ryan had was the time he was with me.”

Moving on to other targets, Mr. Trump said former Vice President Joseph R. Biden Jr., who has been trying to sell himself to Democrats as the levelheaded antidote to Mr. Trump, is “weak and ineffective,” adding, “President Xi laughs at guys like that.” He said that Mr. Xi, the president of China, and other foreign leaders “go to bed at night and they pray that Joe Biden, or somebody like him, becomes president.”

Mayor Bill de Blasio of New York, who is also running for president and has coined the term “Con Don” for his onetime constituent, “doesn’t work very hard,” Mr. Trump said. “Nobody knows what the hell he does.”

When it came to Kim Darroch, the British ambassador who resigned on Monday after the leak of a confidential email in which he described the Trump administration as “clumsy and inept,” Mr. Trump said he wished him well. That was only after berating him on Twitter as a “very stupid guy” and a “pompous fool.” Mr. Trump’s change of tone came, he said, because he was told that Mr. Darroch “actually said very good things about me” and “was sort of referring to other people” in the leaked cable.