WASHINGTON (Reuters) - By plainly stating his policy differences in his resignation letter, U.S. Defense Secretary Jim Mattis has sparked an incipient challenge to President Donald Trump’s foreign and security agenda that sets his departure apart from scores of others that preceded him.

FILE PHOTO: U.S. President Donald Trump speaks to the news media while gathering for a briefing from his senior military leaders, including Defense Secretary James Mattis (L), in the Cabinet Room at the White House in Washington, U.S., October 23, 2018. REUTERS/Leah Millis/File Photo

Mattis, a retired Marine general who was highly regarded by Republicans and Democrats, had far wider political support in Washington than Trump himself when he walked into the White House on Thursday afternoon.

Sources said Mattis had already made up his mind that it was time to go. Later in the afternoon, Trump announced Mattis was retiring, only to be rapidly contradicted as Mattis circulated his eight-paragraph resignation letter.

Even as Washington digested Trump’s surprise decisions this week to remove U.S. troops from Syria and to draw down the military presence in Afghanistan, it was Mattis’ departure and the attendant strategic uncertainty that sources said really vexed officials across the administration and in the U.S. Congress.

It prompted unusually sharp criticism of Trump from his fellow Republicans.

“It’s sadness for our country,” said retiring Republican Senator Bob Corker, adding he thought Mattis’ departure could change how Senate Republicans defend Trump. “We are in a really bad place as it pertains to foreign policy.”

U.S. Republican Senate Majority Leader Mitch McConnell said he was “distressed” by Mattis’ departure. Senator Lindsey Graham, who has mostly been a staunch Trump ally, called for immediate hearings on Trump’s moves in Syria and Afghanistan and wanted to hear directly from Mattis.

Mattis is the first U.S. defense secretary in decades to explicitly resign over purely policy differences with a president.

His departure is wholly different from that of other top foreign policy and national security officials in the administration who have left, including the president’s unceremonious firing of Rex Tillerson as secretary of state. Two national security advisors left Trump - but did so from weakened positions.

‘STATE OF SHOCK’

Trump’s decision to withdraw from Syria was a major contributing factor to Mattis’ departure, and was part of their discussion in the 45-minute conversation on Thursday, as the two men aired their differences, officials told Reuters.

The defense secretary made a final effort on Thursday to convince Trump to reverse course on Syria, one official with knowledge of discussions told Reuters.

Trump, by all accounts, was not pressuring Mattis to resign and had not been expecting an announcement to come that day, sources said.

The Pentagon declined to comment on Mattis’ resignation, referring reporters to his letter.

Even aides to Mattis said they were surprised. “We’re all in a state of shock,” said one U.S. official, speaking on condition of anonymity.

The Republican-led Congress, which has done little to check Trump’s political instincts, including his decision to create a Space Force and to deploy troops to the southern border with Mexico, appeared more ready to step in.

The top Republican on the House Armed Services Committee, Mac Thornberry, rebuked Trump’s plan to withdraw troops from Afghanistan, another surprise move by Trump that leaked in news reports on Thursday.

“Reducing the American presence in Afghanistan and removing our presence in Syria will reverse (U.S.) progress, encourage our adversaries, and make America less safe,” he said.

Hearings are planned in the U.S. House of Representatives, which will be controlled by Democrats starting in January.

The resignation has triggered deep concern among U.S. allies abroad. In Europe, Mattis was seen as a critical advocate for the NATO alliance, which extolled him in a statement on Friday. In Asia, he was credited with building trust and tempering Trump’s isolationist impulses.

TRUMP’S CALL WITH ERDOGAN

Trump’s decision to pull troops from Syria, where he said they are no longer needed against what he called a defeated Islamic State, initially appeared to come out of nowhere. But its genesis, said sources, was a phone call he had with Turkish President Tayyip Erdogan on Dec. 14.

The call was arranged by U.S. Secretary of State Mike Pompeo after Turkey’s threat to launch a military operation against U.S.-backed Syrian Kurdish fighters in the northeast.

Mattis, Pompeo and others helped prepare briefing notes for the call. Trump was supposed to push back against the Turkish plan, according to an official briefed on discussions.

During the call, Erdogan asserted that Islamic State had been defeated and complained that the United States was undermining Turkish security by backing the Kurds, the official said.

That message appealed to Trump, who said the United States did not want to be in Syria and made a snap decision to pull out, ignoring his briefing notes and the advice of Mattis and Pompeo, the official said.

Trump has long been skeptical of the U.S. military mission in Syria that his national security team have advocated to ensure Islamic State’s defeat.

A White House spokesman called this a “false version of events.”