President Donald Trump said on Sunday he would remove Defense Secretary Jim Mattis and replace him with his deputy on Jan. 1, 2019, instead of waiting for the end of February as was previously announced.

Mattis delivered his letter of resignation to the president on Thursday amid disagreements over Syria and Afghanistan. He set Feb. 28 as the end date to his tenure, which Mattis wrote, “should allow sufficient time for a successor to be nominated and confirmed as well as to make sure the Department’s interests are properly articulated and protected at upcoming events to include Congressional posture hearings and the NATO Defense Ministerial meeting in February.”

Trump initially said Mattis would be retiring “with distinction” at the end of February, but he became angry over the news coverage of Mattis' resignation letter, in which he rebuked Trump's foreign policy views, according to The Times.

Hours before the announcement, Trump tweeted that he had given Mattis “a second chance” by picking him to be Defense Secretary.

Trump had told people in his orbit he was considering dropping Mattis from his post, according to The New York Times, and would name Mattis' deputy Patrick Shanahan as the acting secretary of defense while the president searches for a permanent hire.

Trump confirmed he would do so on Twitter just minutes after multiple news outlets wrote of the speculation.

“I am pleased to announce that our very talented Deputy Secretary of Defense, Patrick Shanahan, will assume the title of Acting Secretary of Defense starting January 1, 2019. Patrick has a long list of accomplishments while serving as Deputy, & previously Boeing. He will be great!” Trump wrote on Twitter.

Mattis did not immediately respond to a request for comment from Task & Purpose.

“The Secretary of Defense serves at the pleasure of the President,” Pentagon spokesman Col. Rob Manning told Task & Purpose in a statement. “The department remains focused on national security.”

A former Boeing senior vice president, Shanahan has been serving as deputy secretary of defense since July 2017.

“Deputy Secretary Shanahan will continue to serve as directed by the president and the department will remain focused on the defense of the nation,” Shanahan's spokesman Army Lt. Col. Joe Buccino told Task & Purpose.

SEE ALSO: Read Secretary Mattis’ Letter Of Resignation