Secretary of Defense Jim Mattis is preparing to step down and hand the reins of the Pentagon to Patrick Shanahan, currently the deputy secretary of defense.

On his last day, Mattis sent out a final farewell message to the Department of Defense, urging people to "keep the faith in our country."

On New Year's Eve, his last day on the job, Secretary of Defense Jim Mattis sent a final farewell message to the Department of Defense.

Stressing that the Pentagon has "proven to be at its best when the times are most difficult," he urged the people of the Department of Defense to "keep the faith in our country."

Here's his entire farewell message:

On February 1, 1865, President Lincoln sent to General Ulysses S. Grant a one sentence telegram. It read: "Let nothing which is transpiring, change, hinder, or delay your military movements, or plans."

Our Department's leadership, civilian and military, remains in the best possible 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. Our Department is proven to be at its best when the times are most difficult. So keep the faith in our country and hold fast, alongside our allies, aligned against our foes.

It has been my high honor to serve at your side. May God hold you safe in the air, on land, and at sea.

His message comes a little over a week after he tendered his resignation over irreconcilable differences of opinion with President Donald Trump on a variety of issues, particularly the treatment of America's allies and partners and the country's dealings with adversarial powers.

Read More: Secretary of Defense Jim Mattis quits, says his views aren't 'aligned' with Trump as the president upends major US policies

Mattis straightforwardly explained to Trump in his resignation letter that "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."

The final straw for the outgoing secretary of defense was reportedly the president's decision to withdraw troops from Syria.

Read More: Trump's move to pull US troops out of Syria was reportedly the final straw for Mattis

Mattis was initially expected to step down at the end of February, but Trump reportedly decided to force him out early following coverage of the secretary's resignation letter, which was a clear rebuke of the president's "America First" policies.

Read More: Mattis' resignation letter is a sharp rebuke of Trump's 'America First' philosophy

Mattis will hand over the reins to Patrick Shanahan, who currently serves as the deputy secretary of defense, at 11:59 p.m. Monday.