Following a clash with US President Donald Trump, defense secretary Jim Mattis resigned on Thursday. He told Trump in a letter that he is quitting because “you have a right to have a secretary of defense whose views are better aligned with yours.”

Mattis will be leaving office by the end of February. 

Both the leaders were at loggerheads over America’s role in the world and the abrupt withdrawal of US troops from Syria was the last straw that broke the camel's back. 

Trump took to Twitter to announce the news. “General Mattis was a great help to me…,” wrote Trump. 

His departure was immediately lamented by foreign policy hands and lawmakers on both sides of the aisle, who viewed the retired Marine general as a sober voice of experience in the ear of a president who had never held political office or served in the military. Even Trump allies expressed fear over Mattis’ decision to quit, believing him to be an important moderating force on the president.

Image may contain: text

Image may contain: text

“Just read Gen. Mattis resignation letter,” tweeted Florida Sen. Marco Rubio. “It makes it abundantly clear that we are headed toward a series of grave policy errors which will endanger our nation, damage our alliances & empower our adversaries.”

Mattis did not mention the dispute over Syria in his letter or proposed deep cuts to US forces in Afghanistan, another significant policy dispute. He noted his “core belief” that American strength is “inextricably linked” with the nation’s alliances with other countries, a position seemingly at odds with the “America First” policy of the president.

The defense secretary also said China and Russia want to spread their “authoritarian model” and promote their interests at the expense of America and its allies. “That is why we must use all the tools of American power to provide for the common defense,” he wrote.

The announcement came a day after Trump surprised US allies and members of Congress by announcing the withdrawal of all US troops from Syria, and as he continues to consider cutting in half the American deployment in Afghanistan by this summer. The news coincided with domestic turmoil as well, Trump’s fight with Congress over a border wall and a looming partial government shutdown.

Trump’s decision to pull troops out of Syria has been sharply criticized for abandoning America’s Kurdish allies, who may well face a Turkish assault once US troops leave, and had been staunchly opposed by the Pentagon.

With inputs from Associated Press