WASHINGTON (AP) — Defense Secretary Jim Mattis is stepping down from his post, President Donald Trump announced Thursday, after the retired Marine general clashed with the president over a troop drawdown in Syria and Trump's go-it-alone stance in world affairs.

Mattis, perhaps the most respected foreign policy official in Trump's administration, will leave by the end of February after two tumultuous years struggling to soften and moderate the president's hardline and sometimes abruptly changing policies. The announcement came a day after Trump surprised U.S. allies and members of Congress by announcing the withdrawal of all U.S. troops from Syria, and as he continues to consider shrinking the American deployment in Afghanistan.

In his resignation letter, Mattis alluded to disagreements with Trump as the reason for his departure.

"Because you have the right to have a secretary of defense whose views are better aligned with yours on these and other subjects, I believe it is right for me to step down from my position," Mattis wrote.

Trump said on Twitter that a new secretary will be named soon.

Trump's decision to pull troops out of Syria has been criticized for abandoning America's Kurdish allies, who may well face a Turkish assault once U.S. troops leave. Mattis, in his resignation letter, emphasized the importance of standing up for U.S. allies in an implicit criticism of the president's decision.

"While the U.S. remains the indispensable nation in the free world, we cannot protect our interests or serve that role effectively without maintaining strong alliances and showing respect to those allies," Mattis wrote.

More From Laramie Live