"As you know, President Obama fired him, and essentially so did I", he explained to reporters, contradicting an earlier statement.
During televised remarks ahead of his first cabinet meeting of 2019, Trump claimed he had "essentially fired" Mattis, even though the former Pentagon chief had pointedly quit his post over multiple disagreements.
In a resignation letter that amounted to a rebuke of Trump's view on how to treat alliances and adversaries, Mattis wrote, "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".
"While we are focused on ongoing operations, Acting Secretary Shanahan told the team to remember: China, China, China", the official said.
US President Donald Trump and First Lady Melania Trump greet members of the US military during an unannounced trip to Al Asad Air Base in Iraq on December 26, 2018.
The aides aren't authorized to publicly discuss internal defense meetings and are speaking on condition of condition of anonymity.
Shanahan, 56, did not serve in the military but has worked since July 2017 as the deputy defense secretary.
Soon after arriving at the Pentagon, Shanahan told colleagues to focus on the National Defense Strategy, a Mattis-era review that highlights "Great Power competition" with Russian Federation and China.
The Trump administration has sought to counter China in a variety of areas as Beijing has stepped up its military activities in the South China Sea and elsewhere.
"The National Defence Strategy is [Mattis'] strategy", Shanahan said.
With Shanahan moving up from deputy secretary to acting secretary, the Pentagon's budget chief, David Norquist, has been chosen to fill in temporarily as the deputy secretary, according to Pentagon spokesman Tom Crosson.
Appearing at Mr. Trump's side during Wednesday's Cabinet meeting at the White House on Wednesday, Mr. Shanahan said the Army Corps of Engineers was "dialed in" to help construct additional parts of Mr. Trump's Mexico border wall and that the Pentagon was exploring how to strengthen its support of the Department of Homeland Security's drive to curb illegal immigration.