He claimed to have "essentially" fired Mattis, who had surprised the White House by resigning in protest last month after the president's abrupt decision to pull U.S. forces from Syria.
And Trump, who did not serve in the military and received draft deferments during the Vietnam War, suggested he would have made a good military leader himself.
"I think I would have been a good general, but who knows?" Trump said.
He took credit for falling oil prices, arguing they were the result of phone calls he made to the leaders of oil-producing nations.
"I called up certain people, and I said let that damn oil and gasoline — you let it flow, the oil," he said.
And Trump defended his push to fund his promised border wall, parrying complaints from Democrats who have called the wall immoral by remarking, "Then we have to do something about the Vatican, because the Vatican has the biggest wall of them all."
Trump is entering his third year in the White House with his presidency at its most challenging point.
Democrats bent on investigating his administration and stymieing his agenda will take control of the House on Thursday. The thriving economy he once touted as evidence of his success is showing signs of strain, with financial markets tumbling in recent weeks due in part to worries over his policies and stewardship of the government.
And his new year began with former GOP presidential nominee and incoming Utah Sen. Mitt Romney penning a harsh critique, cheered by the president's Republican detractors, that argued Trump "has not risen to the mantle of the office."
Trump seemed mindful of all this Wednesday as he attempted to seize the spotlight by staging an unusual Cabinet meeting that was geared more toward garnering public attention than serving as a venue for the internal deliberations of his administration.
After saying last month that he would proudly take responsibility for the government shutdown over wall funding, he sought to blame Democrats for not sticking around over the holidays to negotiate. He said he stayed in Washington because the border security debate was "too important a subject to walk away from."
"I was here on Christmas evening. I was all by myself in the White House — it's a big, big house — except for the guys on the lawn with machine guns," he said.
But Trump added confusion to the debate by undercutting Vice President Pence, seated nearby, in dismissing the offer he and other administration officials made to Democrats late last month of accepting $2.5 billion for the wall.
He described the recent stock sell-off as a "glitch" and said markets would soar again on the strength of trade deals he plans this year. But House Democrats may stand in the way of the first of those, a renegotiation of the North American Free Trade Agreement, and markets have been rattled most by the tariffs Trump has imposed on China.
Trump dismissed Romney's scathing criticism of how he's conducted his presidency, saying Romney should be more of a "team player," and played down the idea he could face a primary challenge in 2020.
"They say I am the most popular president in the history of the Republican Party," Trump said.
Amid concerns within his own party about whether he will pull troops out of Afghanistan, Trump offered a discursive and somewhat inscrutable account of the fall of the Soviet Union, blaming it on the 1979 Soviet invasion of Afghanistan.
"Russia used to be the Soviet Union. Afghanistan made it Russia, because they went bankrupt fighting in Afghanistan," Trump said.
His point was that the United States should pull out of hopeless and expensive wars, but he skipped over the many reasons for the collapse of the Soviet Union in 1991 as he held up the loss of empire as an example.
"The reason Russia was in Afghanistan was because terrorists were going into Russia. They were right to be there," he said breaking with the stance taken by past U.S. administrations that the invasion was an illegitimate power play against a neighboring nation.
"The problem is, it was a tough fight. And literally they went bankrupt; they went into being called Russia again, as opposed to the Soviet Union. You know, a lot of these places you're reading about now are no longer part of Russia, because of Afghanistan."
The semblance of a traditional Cabinet meeting broke out from time to time, including when Homeland Security Secretary Kirstjen Nielsen, joining by video connection, briefed the group on the administration's border security efforts and set the tone by claiming, "Mr. President, now more than ever we need the wall."
Trump's Cabinet is pocked by vacancies, as the roster of deputies and placeholders around the table illustrated.
Mattis's formerly prominent place at the Cabinet table was occupied Wednesday by a little-known deputy, Patrick Shanahan, who mostly looked down at his notes as Trump called Syria, where more than 2,000 U.S. troops are deployed, a lost cause of "sand and death."
Several officials in attendance interjected praise for the president at different points.
"I want to thank you for the strong stand you have taken on border security," Pence told him.
Trump, a large poster of himself evoking "Game of Thrones" on the table before him, complained about allies and partners from Afghanistan and Pakistan to India and Germany.
They don't pay their way or expect too much from the United States, Trump said, claiming anew that he is insisting on a reboot of the old expectations about U.S. aid and military obligations.
He claimed that if he wanted to, he could have any government job in Europe and be popular there. He cast his unpopularity among European publics as a sign he is doing his job well.
He defended his controversial negotiations with North Korean leader Kim Jong Un by stating that if he had not reached out, there would have been a "big fat war in Asia."
A second summit with Kim will happen soon, Trump predicted. He did not mention Kim's veiled threat, in a New Year's message, that the United States must not try his patience.
Trump's critics and skeptics on North Korea say he lost leverage by agreeing to the first summit last year and would only lose more with another face-to-face meeting now.
The president, who frequently faces criticism for his light public schedule, also bemoaned the lack of credit he has received for what he views as the many accomplishments of his first two years.
"I have to tell you, it would be a lot easier if I didn't do anything, if I just sat and enjoyed the presidency, like a lot of other people have done," Trump said.