WASHINGTON — Congressional leaders reacted with shock and dismay at the sudden resignation announcement of Defense Secretary Jim Mattis on Thursday, with many blasting President Donald Trump’s reckless policies for forcing the popular former general out of office.

In a resignation letter released Thursday, Mattis said he will step aside in February so Trump can select a new military leader “whose views are better aligned with yours.” The letter appeared to contradict recent White House decisions to withdraw troops from Syria and Afghanistan, and Trump’s overall views on traditional U.S. alliances.

White House press secretary Sarah Sanders downplayed the disagreements in a meeting with reporters Thursday night.

“Secretary Mattis has served the country admirably for over four decades,” she said. “He and the president have a good relationship, but sometimes they disagree. The president always listens to the members of his national team, but at the end of the day it’s the president’s decision to make."

But both Republicans and Democrats on Capitol Hill called Mattis’ departure a severe blow for the administration and the country. Senate Majority Leader Mitch McConnell, R-Ky., called it “regrettable” that Mattis won’t be in the middle of the White House’s key national security discussions anymore.

“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,” he said in an unusual rebuke of Trump. “We must also maintain a clear-eyed understanding of our friends and foes, and recognize that nations like Russia are among the latter.”

House minority leader and presumed next House Speaker Nancy Pelosi, D-Calif., said she was “shaken” by the announcement.

"There is something very wrong with this picture," she told reporters, noting Mattis’ resignation letter raises serious concerns about instability in the administration. “Our troops look to Secretary Mattis as a leader, and now he is going to be leaving them. This is very serious for our country.”

Senate Minority Leader Chuck Schumer, D-N.Y., called Mattis “one of the few symbols of strength and stability in this administration.” Senate Armed Services Committee ranking member Jack Reed, D-R.I., called the resignation a sign of Trump’s misguided defense policies run amok.

“(Mattis) didn’t resign because he grew weary from the fight,” Reed said in a statement. “I think he saw this as his last best chance to focus the nation’s attention on the serious missteps President Trump is making and get him to change course.”

Sen. Lindsey Graham, R-S.C., a prominent supporter of the president who spent much of this week sparring with him over the decision to withdraw 2,000 U.S. troops from Syria in coming months, called Mattis “one of the great military leaders in American history” and urged Trump to “listen to your national security team, who are immensely talented.”

Sen. Ben Sasse, R-Neb., said Mattis “was giving advice that (Trump) needs to hear” and that the president’s policies of isolationism are “weak strategy that will harm Americans.”

Focus on Capitol Hill now turns to who Trump’s pick to replace Mattis may be, and what kind of confirmation fight that nominee will face.

Mattis was so highly regarded among lawmakers that they overwhelmingly approved a waiver allowing him to serve in the civilian defense leadership post even though by law his did not have enough time since his military service to be eligible. The Senate confirmed him by a 99-1 vote just hours after Trump was inaugurated.

A Military Times poll conducted in late September found that nearly 84 percent of troops had a favorable view of Mattis' work leading the armed forces. Among officers, the figure was almost 90 percent