Defense Secretary James Mattis submitted a letter of resignation to President Donald Trump on Thursday, writing that the president deserves “the right to have a Secretary of Defense whose views are better aligned with yours.”

Trump announced Mattis’ resignation on Twitter, saying that Mattis would retire “with distinction” in February after leading the Department of Defense for two years.

“During Jim’s tenure, tremendous progress has been made, especially with respect to the purchase of new fighting equipment,” Trump said, adding that Mattis “was a great help to me in getting allies and other countries to pay their share of military obligations.”

Trump said he would name a replacement for Mattis soon, but did not offer a timetable.

In his resignation letter, Mattis, a former four-star Marine general, appeared to point to his policy differences with Trump, who has frequently clashed with U.S. allies.

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

“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 said.

Mattis joins several other senior administration officials who have recently resigned or announced plans to leave their jobs.

In October, in the run up to the 2018 midterms, UN Ambassador Nikki Haley announced that she would resign. Last week Ryan Zinke resigned as secretary of the Interior Department amid several ethics investigations. Earlier this month Trump announced that White House Chief of Staff John Kelly would resign, and later named Mick Mulvaney, the White House budget director, as his replacement.

Read the full letter here.