WASHINGTON – Defense Secretary Jim Mattis announced Thursday that he is stepping down, citing disagreements with President Donald Trump ranging from Syria to global alliances and sparking deep anxiety among lawmakers about national security.

The announcement of Mattis' departure on Feb. 28 capped a turbulent series of events in which Trump abruptly gave notice Wednesday that 2,000 troops would be withdrawn from Syria, the prospect of a partial government shutdown drew closer and financial markets plunged.

In his resignation letter, Mattis, 68, acknowledged his differences with Trump over the need for alliances and bluntly told him that he should choose a different chief for the Defense Department.

“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 time for me to step down from my position,” Mattis wrote.

Bipartisan expressions of dismay erupted on Capitol Hill on the news.

Senate Democratic leader Charles Schumer accused Trump of "plunging the country into chaos" following the announcement about the defense secretary and amid the uncertainty over whether the government would partially shut down. A deadline of Friday at midnight is looming for the passage of a bill to keep government agencies funded.

Mattis, in his resignation letter, made plain his differences with Trump over the need to keep the U.S. engaged with allies and partners in dealing with world crises.

It was a pointed reference to Trump’s regular disparagement of U.S. allies who he blames for not paying what he believes is their fair share of the burden of defense. In particular, Trump has criticized member countries of NATO, an alliance that Mattis reveres.

"General Mattis was a great help to me in getting allies and other countries to pay their share of military obligations," Trump tweeted. "A new Secretary of Defense will be named shortly. I greatly thank Jim for his service!"

Trump did not mention his disputes with Mattis, who had urged retention of U.S. troops in Syria.

Sen. Jack Reed, D-R.I., and the ranking member of the Armed Services Committee, said Mattis was left with no choice but to resign when it became clear that Trump no longer considered his advice on Syria, Afghanistan and other national security matters.

"He seems to be a casualty of the president's constant need to satisfy his ego," Reed told USA TODAY.

Republicans expressed deep anxiety about Mattis' departure. Sen. Marco Rubio, R-Fla., retweeted the Mattis letter, and said it "makes it abundantly clear that we are headed towards a series of grave policy errors which will endanger our nation." Rubio called for greater "oversight" of Trump administration policies.

More: Trump orders US troops out of Syria, declares victory over ISIS

Senate Majority Leader Mitch McConnell issued a statement saying he was "sorry to learn" that Mattis is leaving. More so, he said, because of the perceived reason for the departure. 

"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," McConnell's statement reads. “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.”

Mattis also took a swipe at Trump’s tweet Thursday in which he defended his decision to withdraw 2,000 troops from Syria. America, Trump tweeted, should not act as the world’s “policeman.”

“Like you, I have said from the beginning that the armed forces of the United States should not be the policeman of the world,” Mattis wrote. “Instead, we must use all the tools of American power to provide for the common defense, including providing effective leadership to our alliances.”

Mattis also pointed to the need to confront China and Russia, noting that his views were influenced by more than 40 years in uniform.

"My views on treating allies with respect and also being clear-eyed about both malign actors and strategic competitors are strongly held and informed by over four decades of immersion in these issues," Mattis wrote.

Trump and Mattis met Thursday to discuss his future and agreed on a separation, officials said. 

An official said Trump and Mattis “had a difference of opinion about Syria,” but officials disputed the idea that was the proximate cause of Mattis’ decision. The two have had disagreements for a long time now, officials said. 

“I don’t know if there was a specific event,” an official said. “But things change.”

“There were things he obviously didn’t agree with the president on,” one official said of Mattis.

Stephen Miller, a senior adviser to the president, played down the significance of Mattis’ departure, telling CNN that it is “very normal at this point in an administration to have turnover.”

Miller said Trump has a “fabulous” relationship with Mattis but that “this president got elected to get our foreign policy back on the right track after years of being adrift.”

Sen. Chris Murphy, D-Conn., tweeted Thursday that Mattis' resignation represents a "national security crisis."

Sen. Ben Sasse, R-Neb., who was critical of Trump's decision to withdraw from Syria, said Mattis was giving Trump advice he "needs to hear." 

Trump was overjoyed when he nominated Mattis, frequently describing him as “Mad Dog” and announcing his appointment at a post-election political rally. Mattis detests the nickname and prefers "Chaos," as some in the military call him.

At the opening of his administration, Trump referred to "his generals," retired brass who held senior positions in his administration. They included Mattis, retired Marine Gen. John Kelly, who served as secretary of Homeland Security and later chief of staff, Army lieutenant generals H.R. McMaster and Michael Flynn, who served as national security advisers. They are all gone, or soon to depart.

Officials said Trump hopes to nominate a successor as soon as possible.

Read Mattis' entire resignation letter.