US Defence Secretary Jim Mattis resigned Thursday after clashing with President Donald Trump over the abrupt withdrawal of US troops from Syria and after two years of deep disagreements over America's role in the world.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 sharply changing policies. He told Trump in a letter that he was leaving because "you have a right to have a Secretary of Defence whose views are better aligned with yours." Mattis went to the White House with his resignation letter in hand to meet with the president and spoke to Trump for about 45 minutes, according to a senior US official familiar with the incident but speaking on conditions of anonymity to discuss a private meeting.There was no confrontation between the two men, the official said, and there was no one issue that caused the resignation. However, the official said, Syria likely was the last straw for Mattis.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."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 defence 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 defence," 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.READ: WATCH: 'We've beaten them badly' - Trump declares victory over ISIS in Syria, orders US troops homeTrump's decision to pull troops out of Syria has been sharply criticised 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.Mattis, in his resignation letter, emphasised the importance of standing up for US allies — an implicit criticism of the president's decision on this issue and others."While the US 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.Last year, Republican Sen. Bob Corker — a frequent Trump critic — said Mattis, along with White House chief of staff John Kelly and then-Secretary of State Rex Tillerson, were helping "separate our country from chaos".Tillerson was fired early this year. Kelly is to leave the White House in the coming days.'Scary'"This is scary," reacted Senate Intelligence committee Vice Chairman Mark Warner, D-Va., on Twitter. "Secretary Mattis has been an island of stability amidst the chaos of the Trump administration.""Jim Mattis did a superb job as Secretary of Defence. But he cannot be expected to stand behind a President who disrespects our allies and ingratiates himself to our adversaries," said William Cohen, who served as defence secretary under Bill Clinton and knows Mattis well.Mattis' departure has long been rumoured, but officials close to him have insisted that the battle-hardened retired Marine would hang on, determined to bring military calm and judgement to the administration's often chaotic national security decisions and to soften some of Trump's sharper tones with allies.Opponents of Mattis, however, have seen him as an unwanted check on Trump.Trump said a replacement would be chosen soon."The president's national security team's job is to give him advice and it's the president's job to make a decision," said press secretary Sarah Sanders.Low profileMattis has determinedly kept a low public profile, striving to stay out of the news and out of Trump's line of fire.Those close to him have repeatedly insisted that he would not quit, and would have to either be fired or die in the job. But others have noted that a two-year stint as defence chief is a normal and respectable length of service.Born in Pullman, Washington, Mattis enlisted in the Marine Corps in 1969, later earning a history degree from Central Washington University. He was commissioned as an officer in 1972. As a lieutenant colonel, he led an assault battalion into Kuwait during the first US war with Iraq in 1991.In the aftermath of the 9/11 attacks, Mattis commanded the Marines who launched an early amphibious assault into Afghanistan and established a US foothold in the Taliban heartland. As the first wave of Marines moved toward Kandahar, Mattis declared, "The Marines have landed, and now we own a piece of Afghanistan."Two years later, he helped lead the invasion into Iraq in 2003 as the two-star commander of the 1st Marine Division. As a four-star, he led Central Command from 2010 until his retirement in 2013.