US Def US Defence Secretary Jim Mattis will be retiring "with distinction" at the end of February, President Donald Trump announced on Thursday.
Mr Trump tweeted that General Mattis "was a great help to me in getting allies and other countries to pay their share of military obligations".
It comes a day after the president's controversial announcement that all US troops would be withdrawn from Syria.
Mr Trump did not name a successor, but said one would be appointed shortly.
In his resignation letter, Gen Mattis described his views on "treating allies with respect" and using "all the tools of American power to provide for the common defence".
"Because you have the right to have a secretary of defence whose views are better aligned with yours on these and other subjects, I believe it is right for me to step down," Gen Mattis wrote.
Mr Trump announced his decision to withdraw some 2,000 US troops from Syria on Wednesday, asserting that the Islamic State (IS) group had been defeated there.
The news, which was met with strong criticism, is at odds with Mr Mattis' position, who had warned that an early withdrawal from the country would be a "strategic blunder".
US troops have helped rid much of Syria's north-east of the jihadist group, but pockets of fighters remain.