President Donald Trump said Defense Secretary Jim Mattis is retiring “with distinction” at the end of February 2019, according to a tweet on Thursday.

“During Jim's tenure, tremendous progress has been made, especially with respect to the purchase of new fighting equipment,” Trump said. “General Mattis was a great help to me in getting allies and other countries to pay their share of military obligations. A new Secretary of Defense will be named shortly. I greatly thank Jim for his service.”

Rumors of Mattis' departure have swirled for months after passages in a new book Fear from investigative journalist Bob Woodward, published in September, depicted the defense secretary as describing Trump as having the understanding of a “fifth- or sixth-grader.”

At the time, Trump had previously publicly supported Mattis, stating that he believed the quotes in Woodward's book were fabrications.

“I asked him whether or not this was true,” Trump said as he met with Republican lawmakers. “He said: ‘Not only is it not true; I’d like to write a statement.’ I said: ‘Thank you very much. That’s very nice.’ He wrote the most beautiful statement. I think he’s a terrific person. He’s doing a fantastic job as secretary of defense.”

Related: Mattis In Winter »

Despite Trump’s assurances that his job was secure, Washington Post columnist Josh Rogin reported on Sept. 5 that the White House had already considering replacing Mattis within the next few months. Retired Army Gen. Jack Keane is considered a top contender.

On the 17th anniversary of the Sept. 11 attacks, Task & Purpose asked Mattis what his relationship was like with the president.

“No problem,” Mattis replied. “It's been the same all along.”

But when T&P; asked him if he intended to serve as defense secretary for the rest of President Trump’s time in office, Mattis demurred, “This is not a day I'm going to go further into politics.”

During his travels abroad, which included a “2+2” meeting in India alongside Secretary of State Mike Pompeo and a surprise visit to Afghanistan, Mattis appeared unflustered despite the political tensions at home.

“Mattis looked weary – he only sleeps a few hours per night – but he showed no outward signs of being under more stress than usual,” as T&P;'s Jeff Schogol, embedded with Mattis during the trip, described the defense secretary. “Like the football player on the Heisman Trophy, Mattis stiff-arms gossip about D.C. power struggles and knife fights so he can get real work done.”

“To call him 'stoic' would be an understatement,” he added. “No matter how tumultuous the world gets, he rarely betrays his emotions.”

This is a developing story and will be updated.