President Trump fired him (after he submitted his resignation) and earlier this week reportedly called him "the world's most overrated general," but former Defense Secretary James Mattis had a few barbs of his own to sling in a speech he gave in New York on Thursday.

Delivering the keynote address at the 75th Alfred E. Smith Memorial Foundation Dinner in New York, Mattis — a retired four-star U.S. Marine general — said he felt he had finally "achieved greatness."

"I'm not just an overrated general, I am the greatest, the world's most overrated," he said to laughter.

"I'm honored to be considered that by Donald Trump, because he also called Meryl Streep an overrated actress," Mattis continued. "So, I guess I'm the Meryl Streep of generals. Frankly that sounds pretty good to me."

The jibes were a departure for Mattis, whose book Call Sign Chaos: Learning to Lead, published in August, met with criticism from some who said he had pulled punches in characterizing the president's erratic leadership style.

In an interview with NPR promoting his book, Mattis declined to discuss his relationship with Trump. "I don't discuss sitting presidents," Mattis said. "I believe that you owe a period of quiet."

Thursday's annual gala, named after the former New York governor who won the Democratic nomination for president in 1928, was hosted this year by Cardinal Timothy Dolan, the archbishop of New York.

Mattis said he'd been asked what he thought of Trump's remarks, which reportedly came during a White House meeting with congressional Democrats on Wednesday.

"I earned my spurs on the battlefield ... Donald Trump earned his spurs in a letter from a doctor," he said in a reference to a medical deferment for bone spurs that kept Trump from serving in the military during the Vietnam War.

Although Trump's nickname for Mattis was "mad dog" - a nickname the former general despised - Mattis said these days he feels more like "an emotional support animal."

"And that's really great, because now the airlines allow me to fly for free," he said.

But Mattis quickly moved on from the jokes and picked up a more serious tone, citing a speech that Abraham Lincoln gave in 1838 to the Young Men's Lyceum of Springfield, Ill.

In it, Lincoln "observed great nations crumble for one of two reasons," the first being foreign invasion, Mattis said, which the future president dismissed as "inconceivable."

The second, he said, paraphrasing Lincoln, "was corrosion from within – the rot, the viciousness, the lassitude, the ignorance."

"Anarchy is one potential consequence of all this. The other is the rise of an ambitious leader, unfettered by conscience, or precedent or decency, who would make himself supreme," he said.

Decrying the lack of bipartisanship, Mattis warned of a "national paralysis" that has "supplanted trust and empathy with suspicion and contempt."

"We have scorched our opponents with language that precludes compromise and we have brushed aside the possibility that the person with whom we disagree might actually sometimes be right," he said.

"We owe a debt to all who fought for liberty, including those who tonight serve in the far corners of our planet, among them the American men and women supporting our Kurdish allies," the retired general said.

In conclusion, Mattis again paraphrased Lincoln, this time that president's famous Second Inaugural speech, delivered in the closing days of the Civil War: "With malice for none and charity for all, let us restore trust in one another."

Copyright 2019 NPR. To see more, visit https://www.npr.org.