Jim Mattis, the former defense secretary, departed from his usual reticence about President Trump and mocked his former boss in a speech on Thursday night that made fun of his bone spur diagnosis during the Vietnam War and his love for fast food.
The president had recently referred to Mr. Mattis, a retired four-star Marine general, as “the world’s most overrated general.” Mr. Mattis picked up the reference and ran with it for several minutes after being introduced as the keynote speaker at the Alfred E. Smith Memorial Foundation Dinner, an annual charity event in New York where politicians and other leaders typically roast one another.
“I’m not just an overrated general,” Mr. Mattis said. “I’m the greatest, the world’s most overrated,” he said, to laughter and applause.
Turning to address Senator Chuck Schumer, Democrat of New York, Mr. Mattis said he “owed” thanks to New York and to Mr. Schumer for bringing up the general’s name during the “contentious” meeting where Mr. Trump called him “overrated.”
In that meeting at the White House on Wednesday, attended by congressional leaders of both parties, Mr. Trump denigrated Mr. Mattis’s approach to combating terrorism in the Middle East. The general resigned last year as secretary of defense in protest of the president’s decision to pull American troops out of Syria.
Mr. Mattis was “the world’s most overrated general,” Mr. Trump told the group. “You know why? He wasn’t tough enough. I captured ISIS. Mattis said it would take two years. I captured them in one month.”
Mr. Mattis said during the speech on Thursday, “I’m honored to be considered that by Donald Trump, because he also called Meryl Streep an overrated actress.”
“So I guess I’m the Meryl Streep of generals,” he said. “And frankly, that sounds pretty good to me.”
“And you do have to admit that between me and Meryl, at least we have had some victories,” he added.
Mr. Mattis went on, saying that people had asked him during the reception before the dinner whether the “overrated” description had bothered him.
“Of course not,” he said in his speech. “I have earned my spurs on the battlefield.”
He added: “Donald Trump earned his spurs in a letter from a doctor.”
The annual dinner is traditionally a Friars Club-style roast where prominent figures take jabs at one another in a white-tie setting where tickets cost more than $1,000.
Mr. Mattis also referred to earlier remarks by the actor Martin Short, who was the master of ceremonies at the dinner, setting up a punch line.
“The only person in the military Mr. Trump does not feel is overrated,” Mr. Mattis said. “That’s Colonel Sanders,” the founder and symbol of Kentucky Fried Chicken.
Before he resigned in December, Mr. Mattis told friends and aides repeatedly that he viewed his responsibility to protect the United States’ 1.3 million active-duty troops as worth the concessions necessary as defense secretary to a mercurial president, The New York Times reported at the time.
“My views on treating allies with respect and also being cleareyed about both malign actors and strategic competitors are strongly held,” Mr. Mattis wrote in his resignation letter. “Because you have the right to have a Secretary of Defense whose views are better aligned with yours on these and other subjects, I believe it is right for me to step down from my position.”