Defense Secretary Jim Mattis’ resignation, which shocked Washington’s national security establishment and rattled America’s allies, was sealed in a fateful 18-hour period that saw President Trump resolve to withdraw troops from Syria – alarming Pentagon officials who see America’s role in the region as crucial.

For Mattis, the president’s order was the final straw, Fox News is told.

“Make no mistake – Jim Mattis is resigning in protest over the president's national security policies,” a senior U.S. defense official told Fox News.

Fox News is told more resignations at the Pentagon could be coming in Mattis’ wake.

CLICK HERE TO GET THE FOX NEWS APP

Trump has stood by his Syria decision, telling detractors that the pullout should come as “no surprise” given his 2016 campaign promises and arguing that America’s role as “Policeman of the Middle East” is not worth the sacrifice.

But Mattis could not abide the call. Fox News has learned new details of the final moments that led the hardened Pentagon leader to march his resignation letter to the White House, setting off speculation – and bipartisan concern – about the direction Trump’s foreign policy will take in the new year, especially with John Kelly leaving as White House chief of staff.

In one telling detail, it appears Mattis’ resignation letter had already been written when he went to the White House at around 3 p.m. on Thursday with the notice in hand. Fifty copies of his resignation letter already had been printed and were in a folder in his office to be distributed upon his return.

Before leaving for the White House, Mattis watched the president's video explaining his decision to pull out of Syria. In the video, Trump declared, “We have won against ISIS … and now it’s time for our troops to come back home.”

Trump then pointed to the sky and suggested he was doing this for the troops who had died.

Mattis spent 45 minutes with the president, Fox News is told, and did not try to change the president’s mind on Syria, despite some reports to the contrary.

According to those familiar with the secretary's decision, it was a resignation based on principle.

It would mark the first time in 40 years that a Cabinet official has resigned over a policy difference. The last person to do so was then-President Jimmy Carter's Secretary of State Cyrus Vance during the failed Iran hostage rescue.

The Pentagon leader’s resignation letter, in diplomatic but unmistakable terms, also made clear that he was leaving the administration over policy disagreements and not job fatigue.

READ THE MATTIS RESIGNATION 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 wrote.

Mattis wrote that he has "been privileged to serve" in his role as defense secretary.

Fox News is told that Mattis believes pulling out of Syria is a betrayal to the Kurds and the Syrian Democratic Forces – U.S. allies whom military leaders believe will be slaughtered once the U.S. leaves Syria.

In Washington, what comes next may be another seminal debate that will define the principles of the Republican Party for years to come. Trump already has altered the party core on issues like trade and entitlements. In his military drawdown effort, Trump has found allies in lawmakers like Sen. Rand Paul, R-Ky., who adamantly oppose U.S. intervention overseas. But for now, they are overwhelmed by hawkish Republicans like Sen. Lindsey Graham who consider such pullouts a grave and strategic mistake.

The Syria pullout was coupled with news that the Pentagon is being told to consider withdrawing up to 7,000 troops from Afghanistan – or half the U.S. presence – against the advice of senior military leaders.

“If we continue on our present course we are setting in motion the loss of all our gains and paving the way toward a second 9/11,” Graham said, regarding Afghanistan.

Earlier this month, Mattis was asked by Fox News’ Bret Baier at the Reagan National Defense Forum whether he was being pressured to pull out of Afghanistan.

Mattis warned of the consequences of doing so: “If we leave, 20-odd of the most dangerous terrorist groups in the world centered in that region, and we walk out of there, then we know what will happen. Our intelligence services are very specific that we will be under attack in a number of years.”

As for what precipitated Trump’s decision, Fox News first reported that Trump agreed to a pullout during a call last week with Turkish President Recep Tayyip Erdogan.

White House Press Secretary Sarah Sanders stressed that Trump and the outgoing defense secretary have a “good relationship” even though they sometimes disagree.

“The president always listens to the members of his national security team but at the end of the day it's the president's decision to make,” she said.

Another factor was also at play in Mattis’ decision, Fox News is told. One source said Mattis had campaigned for Air Force Chief of Staff Gen. David Goldfein to replace outgoing Joint Chiefs of Staff Chairman Gen. Joe Dunford.

Trump, however, went with Army Chief of Staff Mark Milley, which came as a blow to Mattis.

Fox News’ John Roberts contributed to this report.