Washington: U.S. President Donald Trump on Sunday said he was replacing Defense Secretary Jim Mattis on January 1 with deputy defense secretary Patrick Shanahan in an acting capacity after Mattis resigned over policy differences and offered to stay in his post for two more months.

A source familiar with the situation told Reuters that Trump was irked by the attention given to Mattis’ resignation letter, which implicitly criticized Trump’s foreign policies and his treatment of military allies after the president’s decision to pull troops out of Syria.

Trump announced Shanahan’s appointment in a tweet, calling the former Boeing Co executive “very talented".

In a shock announcement on Wednesday, Trump said he was withdrawing U.S. troops from Syria, a decision that upended American policy in the region.