WASHINGTON — President Donald Trump claimed he had fired Defense Secretary Jim Mattis and said his progress in Afghanistan was “not too good” during a meeting of his new Cabinet at the White House on Wednesday.

The comments come just two days after Mattis stepped away from his Pentagon leadership post and show an increasing level of animosity between the commander in chief and his former military leader.

Mattis announced his resignation from the Cabinet post on Dec. 20, saying the move would allow the president to find “a secretary of defense whose views are better aligned with yours.” In his resignation letter, he took aim at Trump’s past criticism of foreign allies and his decision to withdraw U.S. troops from Syria in the months ahead.

Mattis had planned a departure date of late February, but Trump announced just three days later that Deputy Defense Secretary Patrick Shanahan would assume the acting defense secretary role on Jan. 1, forcing the former Marine Corps general out early.

Initially, Trump called Mattis' departure a “retirement” and praised the outgoing defense secretary for “tremendous progress” in implementing his plans to build up military funding and readiness.

But on Wednesday, with Shanahan in attendance for a White House leadership meeting, Trump suggested that Mattis had underperformed in his job.

“What’s he done for me? How had he done in Afghanistan? Not too good,” Trump said.

× Fear of missing out? Sign up for the Early Bird Brief - a daily roundup of military and defense news stories from around the globe. Thanks for signing up. By giving us your email, you are opting in to the Early Bird Brief.

“I’m not happy with what he has done in Afghanistan. And I shouldn’t be. I wish him well. I hope he does well. As you know, President [Barack] Obama fired him, and essentially so did I. I want results."

Mattis was relieved of his U.S. Central Command leadership post months early in 2013 because of concerns from some in the Obama administration he had become too aggressive in policy recommendations to counter Iran.

Last month, during his Shanahan announcement, Trump also mentioned the Obama firing and suggested that Mattis was less popular than the media has portrayed him.

“When President Obama ingloriously fired Jim Mattis, I gave him a second chance,” Trump tweeted. “Some thought I shouldn’t, I thought I should. Interesting relationship-but I also gave all of the resources that he never really had. Allies are very important-but not when they take advantage of U.S.”

When President Obama ingloriously fired Jim Mattis, I gave him a second chance. Some thought I shouldn’t, I thought I should. Interesting relationship-but I also gave all of the resources that he never really had. Allies are very important-but not when they take advantage of U.S. — Donald J. Trump (@realDonaldTrump) December 23, 2018

A Military Times poll conducted in late September found that nearly 84 percent of troops had a favorable view of Mattis' work leading the armed forces. Among officers, the figure was almost 90 percent.

Mattis' departure has drawn significant concern from both Democrats and Republicans on Capitol Hill, many of whom have publicly praised Mattis’ steady demeanor and military knowledge for helping moderate some of Trump’s impulsive policy decisions.

On Monday, in a farewell letter to Defense Department employees, Mattis wrote that the military’s leadership “remains in the best possible hands” and encouraged all troops and civilians there to “keep faith in our country and hold fast, alongside our allies, aligned against our foes.”

At the Cabinet meeting, Trump pushed back on reports of a rapid troop withdrawal from Syria, confirming only that it will happen “over a period of time.” He also repeated his claims that Islamic State fighters have been defeated in the Middle East, despite military commanders’ past public comments expressing reservations about declaring victory in the region.

“I’m the only person in the history of our country who could really decimate ISIS," Trump said. “Everyone gives me credit for decimating ISIS … but I’m the only one who could do that and get bad publicity.”

He said that Syria “was lost long ago.”

“We are talking about sand and death,” he said. “We are not talking about vast wealth.”

Shanahan spoke at the Cabinet meeting before the president’s comments on Mattis, and did not offer a response to the remarks afterwards. He said the military has been working closely with the Department of Homeland Security and other agencies on southern border security efforts.

“The threat is real, the risks are real,” he said. “We need to control our borders.”