President Donald Trump’s defense secretary, James “Mad Dog” Mattis, just became the latest administration official — and military general — to exit the White House.

“General Jim Mattis will be retiring, with distinction, at the end of February, after having served my Administration as Secretary of Defense for the past two years,” Trump announced on Twitter late Thursday afternoon.

Mattis's exit punctuates a particularly strained week in foreign policy for the White House. Trump announced Wednesday he was abruptly pulling the remaining U.S. troops out of Syria, saying that “we have defeated ISIS.”

That decision didn't exactly go over well on Capitol Hill, where members of his own party expressed shock and outrage. Republican Sen. Lindsey Graham criticized the move and said in an interview with CNN that he thinks Mattis "firmly" believes "the job in Syria is not yet done.”

Indeed, Mattis believed the move might cause more chaos in the region, according to the Washington Post, and tried repeatedly to convince Trump to reverse course.

Mattis hinted at his disagreement over Syria in his resignation letter to Trump, writing that the president should hire a person with views that are “better aligned” with his own.

"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.

Mattis was the last of Trump’s “generals,” a class including John Kelly, the former White House chief of staff, and H.R. McMaster, former national security advisor. During the early days of Trump’s administration, the generals were believed to have formed a fairly consistent check on Trump’s erratic and at times, unprecedented, behavior, especially in the field of foreign policy.

Most of the officials who similarly sought to balance the unorthodox views of the president, like former Secretary of State Rex Tillerson, have also left the White House.

In his resignation letter, Mattis also spoke of treating U.S. allies with “respect," another apparent reference to the turmoil created by Trump's sudden decision on Syria.

“We must do everything possible to advance an international order that is most conducive to our security, prosperity, and values, and we are strengthened in this effort by the solidarity of our alliances," he wrote.

Trump said Mattis’ successor will be named soon, but did not offer a date.