WASHINGTON (Reuters) - Trump’s presidency has lurched from crisis to crisis since he took office less than two years ago, but Thursday was a landmark day of chaos that appeared to test the resolve of even senior Republican backers in Washington.

Defense Secretary James Mattis, a widely respected figure seen as a stabilizing influence inside the administration, handed in his resignation after arguing with Trump over foreign policy in a White House meeting.

Mattis then released a letter that showed fundamental policy differences between the two men and implicitly criticized Trump’s disregard for allies abroad.

Also on Thursday, Trump resisted pressure to stand down from a decision to withdraw U.S. troops from Syria, made plans to pull American forces out of Afghanistan and pushed the U.S. government toward a shutdown over funding for a border wall.

To top it all off, U.S. share prices tumbled as investors worried the looming shutdown, slower economic growth and the Federal Reserve’s projections for more interest rate hikes next year.

Even some of Trump’s friends showed deepening worry about where his administration is heading at the halfway point of his term.

Senator Lindsey Graham, a close ally and frequent golf partner, on Thursday praised Mattis, publicly urged Trump to reconsider the Syrian pullout and warned that withdrawing troops from Afghanistan could ultimately lead to another attack on America similar to the one on Sept. 11, 2001.

“I believe you are on course to make the same mistake President (Barack) Obama made in Iraq ... It will turn out no better for you than it did for him.” Graham tweeted of the Syria move.

Graham said the conditions in Afghanistan made troop withdrawals a high-risk strategy. “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.”

Senate Majority Leader Mitch McConnell issued a statement expressing grave reservations about why Mattis left.

“I am particularly distressed that he is resigning due to sharp differences with the president on ... key aspects of America’s global leadership,” he said.

U.S. President Donald Trump arrives for a signing ceremony for H.R. 2, the "Agriculture Improvement Act of 2018" in Washington, U.S., December 20, 2018. REUTERS/Jim Young

It was a vivid reminder of the early months of Trump’s White House, when he fired his first national security adviser, Michael Flynn, after only days in office, fired then-FBI Director James Comey and launched a travel ban against majority Muslim countries that was blocked by the courts.

HEADING FOR A TOUGH YEAR

Trump already faces a difficult 2019, likely to be dominated by a special prosecutor’s investigation into whether his 2016 campaign colluded with Russia and congressional probes into his businesses, his family and some cabinet members.

Democrats will take control of the U.S. House of Representatives in January and plan to use their power to dig deep into Trump’s past and his administration.

Those Democrats, eager to soften Trump up for his expected run for re-election in 2020, leaped to take advantage of the scenes of turmoil on Thursday.

“It is a shame that this president, who is plunging the nation into chaos, is throwing another temper tantrum and is going to hurt lots of innocent people,” said U.S. Senator Chuck Schumer of New York, the top Democrat in the Senate.

“The Trump temper tantrum will shut down the government, but it will not get him his wall,” Schumer said.

Without the chaos, Trump might have had a good week.

He celebrated a rare bipartisan success with Senate passage of prison reform legislation, an initiative pushed by his son-in-law and senior adviser Jared Kushner.

He also signed a major farm bill and promoted the ceremony with a moment of levity: He tweeted a video of himself from the Emmys awards show from years ago wearing farm attire - a straw hat, denim overalls and waving a pitch fork - and sang the theme song to the old “Green Acres” TV show.

Aides said he has been in a good mood for the most part, spending some of the pre-holiday week reconnecting with old friends. He has sat down for sessions with allies in the Oval Office and attended holiday receptions in the residence with friends.Behind the scenes, however, his White House team has been struggling to keep up. His new White House Chief of Staff Mick Mulvaney has scrambled to meeting after meeting.

So too has national security adviser John Bolton, an Iran hawk who had wanted to keep U.S. troops in Syria as a counter to Tehran.

Since the midterm elections, Trump has fired Attorney General Jeff Sessions and White House Chief of Staff John Kelly after they lost his confidence, as well as Interior Secretary Ryan Zinke, who is under an ethics cloud.

Others who were previously seen as on the way out may stay longer.

Trump is said by aides to be pleased by Homeland Security Secretary Kirstjen Nielsen for toughening her approach to the border, and Commerce Secretary Wilbur Ross is unlikely to be forced out unless he wants to leave.

But Mattis’ resignation was jarring.

White House spokeswoman Sarah Sanders told reporters that she did not believe Trump had asked Mattis to resign.

“The president had a good relationship (with Mattis), but sometimes they disagree. The president always listens to the members of his national security team, but at the end of the day it is the president’s decision to make,” she said.