The Department of Defense on Friday tweeted about the withdrawal of U.S. troops from Syria, saying that it's carefully planned and organized.

The department described the course of action as being “deliberate, well thought-out, mutually supportive, and controlled,” while also guaranteeing “our troops’ safety and protection.”

The tweet came days after a senior defense official told Fox News that Defense Secretary Jim Mattis signed orders to pull all American troops out of the country in the coming weeks. Pentagon officials would not talk about the details, citing operational security.

CLICK HERE TO GET THE FOX NEWS APP

Mattis gave his resignation letter to President Trump earlier this month, in which he acknowledged that a strong nation relies on a "comprehensive" network of alliances, and must be "resolute and unambiguous" in approaching countries with strategic differences, citing China and Russia.

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

Following word of his resignation, a senior U.S. defense official told Fox News that “Mattis is resigning in protest over the president's national security policies.”

On Sunday, Trump tweeted that Mattis would be departing his post on Jan. 1, roughly two months earlier than expected.

The president recently defended his decision regarding the Syria withdrawal, saying on a visit to Iraq Wednesday that U.S. military gains against the Islamic State (ISIS) terror group have made it possible for him to pull out the 2,000 U.S. troops.

TRUMP, VISITING TROOPS IN IRAQ, DEFENDS SYRIA PULLOUT PLAN

"I made it clear from the beginning that our mission in Syria was to strip ISIS of its military strongholds," Trump said.

A U.S. presence in Syria was never to be "open-ended," the president also said, adding that Turkey has agreed to eliminate ISIS remnants.

Trump's surprise visit to the region came a week after he declared that ISIS had been “defeated” in Syria in a tweet and ordered all American diplomats and soldiers out of the country.

The U.S. first deployed troops to Syria in 2015 during the Obama administration as part of a partnership with Kurdish-led forces against ISIS. A year before the deployment, U.S. airstrikes began in Syria.

Fox News’ Lucas Tomlinson, Jennifer Griffin, Travis Fedschun and Frank Miles contributed to this report.