Former Defense Secretary James Mattis hit back at his old boss at a white-tie gala in New York on Thursday, saying that he's not just an overrated general, he's the greatest overrated general.

Mattis made the joking remarks at the annual Alfred E. Smith Memorial Foundation Dinner, a day after President Donald Trump demeaned him as "the world's most overrated general" during a contentious White House meeting with members of Congress.

Among Mattis' zingers was a comparison he made to actress Meryl Streep.

"I'm honored to be considered that by Donald Trump because he also called Meryl Streep an overrated actress," he joked. "So I guess I'm the Meryl Streep of generals and frankly that sounds pretty good to me, and you do have to admit between me and Meryl, at least we've had some victories."

The White House meeting Wednesday was intended to be a bipartisan discussion of Trump's decision to pull U.S. forces from northern Syria, but it broke up after a testy exchange between Trump and House Speaker Nancy Pelosi.

Before the walkout, Trump disparaged Mattis, who had argued as defense secretary that U.S. troops were needed in Syria to prevent a resurgence of Islamic State fighters.

Trump said Mattis "wasn't tough enough," and went on to say, "I captured ISIS."

The retired Marine general Mattis resigned as defense secretary last December after Trump said he intended to pull 2,000 American troops out of Syria. In his resignation letter, he told Trump he had "the right to have a Secretary of Defense whose views are better aligned with yours."

Since then, he has largely refrained from criticizing the administration publicly, saying he owed the commander in chief "a duty of silence."

But he broke that silence at the laughter-filled gala, saying that the "overrated general" jab didn't bother him.

"Some of you were kind during the reception and asked me if this bothered me to have been rated this way based on what Donald Trump said," he said. "I said of course not. I earned my spurs on the battlefield ... And Donald Trump earned his spurs in a letter from a doctor."

Trump's decision to have U.S. troops stand down in Syria cleared the way for Turkey to launch an offensive against Kurdish forces in northern Syria who had been U.S. allies in the fight against the Islamic State. On Thursday, the U.S. and Turkey agreed to a five-day cease-fire that requires the Kurdish fighters to vacate, largely solidifying Turkey's position in the region.

The annual roast, hosted by New York Archbishop Cardinal Timothy Dolan, draws luminaries from finance and politics. It's named after a former New York governor who was the first Catholic to receive a major party nomination for president when he unsuccessfully ran in 1928. It benefits a charitable foundation.