For the last year, former defense secretary Jim Mattis has taken heat for his reluctance to directly criticize President Trump, especially after he resigned from the position in protest last December. The celebrated Marine Corps general has consistently demurred when asked to rebuke Trump’s foreign relations or military decisions.

For one night at least, on Thursday, Mattis dropped that tendency as he saturated a comedic keynote address with direct jabs at Trump, who earlier this week called his former Cabinet official “the world’s most overrated general.”

“I’m honored to be considered that by Donald Trump because he also called Meryl Streep an overrated actress,” Mattis said in his keynote speech at the annual Alfred E. Smith Memorial Foundation Dinner in New York. “So, I guess I’m the Meryl Streep of generals.”

When Mattis stepped down, the former defense secretary, who sparred with Trump over military actions between 2016 and 2018, said the president deserved to have someone “whose views are better aligned” in his Cabinet. On Sunday, Mattis offered words of caution regarding Trump’s decision to pull U.S. troops out of Syria during an interview on “Meet the Press,” warning that the Islamic State would “resurge” without military pressure in the region.

The president did not appreciate the general airing those concerns publicly.

“You know why?” Trump told lawmakers Wednesday. “He wasn’t tough enough. I captured ISIS. Mattis said it would take two years. I captured them in one month.”

On Thursday evening, Mattis didn’t stop at responding to the president’s recent barb. He also teased Trump for dodging the draft for the Vietnam War because of the “bone spurs” that the president has said he had in both of his heels.

“I earned my spurs on the battlefield,” Mattis said. “Donald Trump earned his spurs in a letter from a doctor.”

Mattis also mocked the president’s love of fast food.

“I think the only person in the military that Mr. Trump doesn’t think is overrated,” the general said, “is Colonel Sanders.”

The White House did not immediately return a request for comment about Mattis’s remarks.

President Trump spoke about his former defense secretary at a Cabinet meeting Jan. 2, saying he was not "too happy" with how Jim Mattis handled Afghanistan. (The Washington Post)

Several high-profile politicians at the dinner, a charity event known for comedic roasts, saluted Mattis’s flippant speech. Senate Minority Leader Charles E. Schumer (D-N.Y.) tweeted a photo of himself chatting with the general after the event.

“While [Trump] was having another rally, it was great to catch up with General Mattis — the Meryl Streep of Generals,” he wrote.

But for other observers, Mattis’s zingers drew attention to the military officer’s reticence to substantively criticize the president.

“I know he’s speaking at a dinner meant for jokes, but this is just an absurd and undignified way for Mattis to make his first public critiques of the president,” Susan Hennessey, a Brookings Institution senior fellow and executive editor of the Lawfare blog, said in a tweet Thursday. “After indefensible silence, this will surely undercut the gravity of any future words he might have on the subject.”

Thomas M. Nichols, a professor at the U.S. Naval War College in Rhode Island, said he did not think the speech was an occasion for laughter.

“I don’t think anyone should be chuckling at Mattis’s brush off of Trump’s insult,” he wrote on Twitter. “It’s his facile way of dodging the reality that he knows a lot about what happened in this White House, including what are now obviously impeachable acts directly related to his time as SECDEF.”

Critics contrasted Mattis’s jokes with an op-ed penned by retired Navy Adm. William H. McRaven in the New York Times on Thursday, which sharply rebuked the president. Titled “Our Republic Is Under Attack From the President,” the Navy officer’s piece slammed Trump for abandoning the Kurdish soldiers who fought in Syria as America’s allies. “He is wrong,” McRaven wrote.

Mattis has defended his decision to keep his personal beliefs about the Trump administration private.

“If you leave an administration, you owe some silence,” he told the Atlantic in an interview first published in August. “When you leave an administration over clear policy differences, you need to give the people who are still there as much opportunity as possible to defend the country. They still have the responsibility of protecting this great big experiment of ours.”

The general cut ties with Trump in December 2018 over disagreements about how the U.S. should treat its foreign allies and adversaries.

“My views on treating allies with respect and also being clear-eyed about both malign actors and strategic competitors are strongly held and informed by over four decades of immersion in these issues,” he wrote in his resignation letter.

Since leaving Trump’s Cabinet, the former defense secretary has remained mostly mum on U.S. foreign and military policy. Even in his recently released memoir, “Call Sign Chaos,” the military leader refrains from discussing much of his time within the Trump administration. Mattis has hinted that one day he may speak out against Trump’s policy decisions more directly, saying he does not owe the president his silence “forever.”

Some wondered Thursday evening if his jokes were a harbinger more substantive criticisms. To laughter and applause, Mattis struck another comedic blow at the dinner, this time emphasizing his own illustrious military career.

“You do have to admit,” he said, “between me and Meryl, at least we’ve had some victories.”