President Donald Trump announced Thursday that Mattis will leave the job in February. The announcement came a day after Trump said that U.S. troops would leave Syria.
The Defense Department opposed the troop withdrawal.
For several years, U.S.-supported forces in the Middle East have made progress against the Islamic State (IS). Defeating IS forces was just one part of a plan Mattis had for Syria. He wanted to reduce U.S. troop numbers there after successful completion of the three-part plan.
The president and Mattis disagreed on the issue. They also have different ideas about support for America's traditional alliances. In his resignation letter, Mattis wrote that the United States cannot protect its interests without "showing respect to (our) allies."
The French Defense Minister Florence Parly spoke about the resignation. She said that French forces were in the Middle East as part of a coalition "led by the Americans." Trump's decision "changes that situation," she added.
Britain's Minister of State for the Middle East, Alistair Burt, wrote that "If allies cannot be relied upon, others are sought to take their place." The social networking website Twitter published his comments.
Former Swedish Prime Minister Carl Bildt tweeted the U.S. move was a "morning of alarm in Europe."
Defense Secretary Mattis is one of the most highly respected members of Trump's foreign policy team. He helped lead the invasion of Iraq in 2003 and later led the U.S. Central Command until he retired in 2013.
In his resignation letter to Trump, Mattis wrote that the president should have a Secretary of Defense who agreed with him on foreign policy. He added, "I believe it is right for me to step down from my position."
In addition to Syria, the two men disagreed about other issues, such the president's decision to pull the United States out of the nuclear deal with Iran. They also have differences of opinion about Russian President Vladimir Putin.
Trump has praised Putin's leadership skills. Mattis believed the Russian president was interfering with Western democracies.
Russia has praised the U.S. decision to withdraw from Syria. In a separate move, Trump ordered the Defense Department to plan to withdraw about 50 percent of the 14,000 U.S. troops in Afghanistan. That withdrawal will reportedly begin in January 2019.
U.S. congressional reaction
Reacting to Mattis' resignation, Senate Majority Leader Mitch McConnell said he was "distressed" that it resulted from "differences (about) America's global leadership."
House Minority Leader Nancy Pelosi said she was "shaken" by the resignation and described it as "very serious for our country."
"This is scary," tweeted Senator Mark Warner of Virginia. He is the top Democrat on the Senate Intelligence Committee.
Trump's decision to leave Syria breaks with one of America's longtime allies, the Kurds. Turkish President Recep Tayyip Erdogan has threatened in recent days to launch a military operation against U.S.-aided Kurdish militiamen now fighting in northeastern Syria.
I'm Susan Shand.