Washington (CNN) Shaken, disappointed, saddened and scared -- those were just some of the reactions in a bipartisan outpouring of shock and concern as lawmakers reacted Thursday to the news that Defense Secretary James Mattis had resigned over President Donald Trump's policy decisions.

"Just read Gen. Mattis resignation letter," Republican Sen. Marco Rubio of Florida tweeted. "It makes it abundantly clear that we are headed towards a series of grave policy errors which will endanger our nation, damage our alliances & empower our adversaries."

"This chaos," Ohio Republican Gov. John Kasich said on Twitter, "both foreign and domestic, is putting America in danger and must stop immediately."

At the Pentagon, military officers and civilian officials expressed dismay at the news, but the overriding sentiment was shock. "People are stunned," CNN's Ryan Browne reported.

'The wheels may be coming off'

"This is scary," tweeted Sen. Mark Warner of Virginia, the ranking Democrat on the Senate Intelligence Committee. "Secretary Mattis has been an island of stability amidst the chaos of the Trump administration."

News of Mattis' resignation broke as Trump faced an imminent government shutdown, the Dow had plunged more than 1,200 points since Monday and the President was being blasted for foreign policy decisions. On Wednesday, Trump had announced that the US will pull its troops from Syria because "we have defeated ISIS," and earlier Thursday, CNN's Jake Tapper reported that officials throughout the administration were bracing themselves for Trump to make an announcement about the US presence in Afghanistan.

"The wheels may be coming off," said a conservative House Republican who supports Trump, commenting on the news about Mattis' departure at the end of February.

Retired Gen. Stanley McChrystal said that "the kind of leadership that causes a dedicated patriot like Jim Mattis to leave should give pause to every American."

Former CIA Director Leon Panetta simply sounded furious. "The last damn thing we need is more chaos and crisis," Panetta told CNN's Erin Burnett.

"This is a President who operates somehow by his gut instinct and how he reads the politics of the moment," Panetta said.

"He enjoys chaos" because he believes it brings him more attention, "but a steady diet of chaos creates hell for the American people," Panetta continued. "We need a president who is going to make the right decisions and provide stability for this country."

'Straw that broke the camel's back'

Mattis said in his resignation letter to Trump 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 letter capped months of tension over policy disagreements and amounted to a rebuke of several of Trump's foreign policy views. The defense secretary stressed the importance of US alliances and of being "unambiguous" in approaching adversaries like Russia and China. It did not contain a whiff of praise for the President.

Just read Gen. Mattis resignation letter. It makes it abundantly clear that we are headed towards a series of grave policy errors which will endanger our nation,damage our alliances & empower our adversaries. 1/2 pic.twitter.com/ztc0Yihccn — Marco Rubio (@marcorubio) December 20, 2018

Rep. Eliot Engel, a New York Democrat who's the incoming chairman of the House Foreign Affairs Committee, said he believes the President's decision on Syria was "the straw that broke the camel's back" for Mattis.

"He couldn't just go along with it," Engel said. "How can you continue to work for an administration whose foreign policy is not something that you believe? ... How can you keep working for a boss whose policies you don't believe in?"

Others called, directly and indirectly, for oversight and possibly intervention.

Warner tweeted that "as we've seen with the President's haphazard approach to Syria, our national defense is too important to be subjected to the President's erratic whims."

Rubio tweeted, "I hope we who have supported this administrations initiatives over the last two years can persuade the President to choose a different direction. But we must also fulfill our constitutional duty to conduct oversight over the policies of the executive branch."

Secretary Mattis' resignation is a significant loss and shows that that President Trump's foreign policy agenda is spiraling into chaos. Read my full reaction: pic.twitter.com/dtGemheNT6 — Senator Bob Menendez (@SenatorMenendez) December 21, 2018

Sen. Ben Sasse said it was a "sad day" for America.

"General Mattis was giving advice the President needs to hear," the Nebraska Republican said in a statement. "Mattis rightly believes that Russia and China are clear adversaries and that we are at war with jihadists across the globe who plot to kill Americans at home. Isolationism is a weak strategy that will harm Americans and America's allies. Radical Islamic jihadists are still at war with us, and no ISIS is not gone."

House Armed Services Chairman Mac Thornberry said he was "disappointed" that Mattis is leaving, though he said he wants to write out his thoughts before elaborating.

Asked if he has any interest in the job, the Texas Republican jumped into an elevator and said he "scoffed" at the notion.

Thornberry's replacement, the incoming chairman of Armed Services, Rep. Adam Smith, said the news of Mattis' resignation is "very disappointing."

"He will be missed," the Washington state Democrat said.

'There is chaos now'

"I'm sad. I'm shaken by it. I had so much respect for him," House Minority Leader Nancy Pelosi told CNN. Like many, the California Democrat expressed discomfort at Trump's erratic and impulsive leadership style. Mattis had been a "comfort to many of us as a voice of stability in the Trump administration," Pelosi told reporters later.

Senate Minority Leader Chuck Schumer called Mattis "one of the few symbols" of "strength and stability" in the administration. "There is chaos now," he said.

"This week was one of the most chaotic weeks we've ever seen in American government," the New York Democrat added.

Rep. Eric Swalwell, headlining a town hall in Iowa on Thursday, responded to the news by suggesting that it is now only Trump and his adviser Stephen Miller making decisions together.

"I at least had some peace in knowing there were adults in the room, and now (chief of staff John) Kelly and Mattis are gone," the California Democrat said, calling the prospect of decisions by Miller and Trump "terrifying."

He added: "Some of the best hope for order at the White House, those people are leaving."

Republican Sen. Lindsey Graham of South Carolina, sometimes seen as a possible candidate for defense secretary, tweeted that he'd learned of the news "with great sadness."

Graham, a strong Trump supporter who nonetheless opposes the President's decision to pull out of Syria, continued: "Mattis is a combination of intellect and integrity. He has been in the fight against radical Islam for decades and provided sound and ethical military advice to President Trump."

Senate Majority Leader Mitch McConnell said late Thursday, in strong comments by his standards: "I believe it's essential that the United States maintain and strengthen the post-World War II alliances that have been carefully built by leaders in both parties. We must also maintain a clear-eyed understanding of our friends and foes, and recognize that nations like Russia are among the latter. So I was sorry to learn that Secretary Mattis, who shares those clear principles, will soon depart the administration."

"But I am particularly distressed that he is resigning due to sharp differences with the president on these and other key aspects of America's global leadership," the Kentucky Republican said in a statement, "It is regrettable that the president must now choose a new Secretary of Defense. But I urge him to select a leader who shares Secretary Mattis's understanding of these vital principles and his total commitment to America's servicemembers."