​Hours before Deputy Defense Secretary Patrick Shanahan was to take the helm as the US military’s top leader, outgoing Defense Secretary Jim Mattis urged military members to remain focused on the mission, saying the Department of Defense remains in good hands.

“I am confident that each of you remains undistracted from our sworn mission to support and defend the Constitution while protecting our way of life,” wrote Mattis in a farewell address to troops on Dec. 31. “Our department has proven to be at its best when times are most difficult. So keep the faith in our country and hold fast, alongside our allies, aligned against our foes.”

Mattis, who has led the department since January 2017, resigned on Dec. 20, citing multiple policy differences with the administration and saying President Trump deserved a Defense Secretary whose views more closely aligned with his own. He offered to stay on through Feb. 1, to ensure a smooth transition to the next Defense Secretary, but Trump took to Twitter a few days later and announced that Shanahan would temporarily assume the position until a new SecDef, who has not yet been named, is confirmed.

The official transition took place before 11:59 p.m. on Dec. 31 via a scripted telephone call between Mattis and Shanahan, according to a defense official. The department “is not authorized” to release a transcript of that call, but its purpose is to “ensure all members within the government know who is in command,” according to the official.

Shanahan, a former Boeing executive, had served as deputy defense secretary since July 2017. He has overseen many of the department's acquisition programs and the development of the plan for a separate military service for space.

“Our foundational strength lies in the remarkable men and women who volunteer to serve our country and protect our freedoms, while making immense personal sacrafice,” Shanahan wrote in the statment, adding that it is “an honor to work with such a dedicated team.”

Mattis also wrote in his memo to troops that it “has been an honor to serve at your side.”