Russia is the principal threat facing the United States, and the new administration should increase support to allies in the face of the Kremlin’s attempts to “break the North Atlantic alliance,” Donald Trump’s choice for defense secretary testified Thursday.

Retired Marine Gen. James Mattis, speaking at his confirmation hearing before the Senate Armed Services Committee, said the U.S. and its NATO partners must strengthen the mutual defense alliance.

“NATO from my perspective is the most successful military alliance in modern world history—maybe ever,” Mattis, 66, testified. “My view is nations with allies thrive and nations without allies don’t. If we did not have NATO today, we would need to create it. It is vital to the security of the United States and vital to the protection of the democracies we are allied with.”

Trump said during the campaign that under his administration, American military support for NATO could be conditional on whether member states have met their financial obligations to the alliance.

Mattis tried to assuage concerns that the U.S. would not commit to the alliance, telling senators he is “confident the president-elect expects us to live up to our word with Article 5” of the NATO treaty, which enshrines the principle that an attack against one member is an attack against all.

To underline that point, Mattis said he supports a permanent U.S. military presence in the Baltic nations to deter Russian aggression.

In a moment where Russia is under fire for interfering in the U.S. election, and the Kremlin’s fingerprints are all over some of the world’s dominant conflicts, including the war in Syria, Mattis urged caution on working with Russian President Vladimir Putin.

“I am all for engagement, but we also have to recognize reality and what Russia is up to,” Mattis said. “He [Putin] has chosen to be both a strategic competitor and adversary in key areas. I have very modest expectations about areas of cooperation with Mr. Putin.”

Mattis is known and admired as “Mad Dog” in the military, though it is a nickname he says he loathes because it doesn’t fit the sober-mindedness with which he views the use of military force.

His forecasting of world challenges, and his proposed approach to them, seemed to impress members of both parties on the Armed Services Committee.

After the hearing, the Senate quickly voted 81-to-17 to grant Mattis a waiver to run the Pentagon, an action required because he retired from the military only four years ago.

Under federal law, defense secretaries must have been retired from military service for seven years, unless Congress grants a waiver.

The House must still vote on the waiver before the Senate votes on formally confirming Mattis.

Senators who questioned Mattis said they hoped he would take seriously the doctrine of civilian control of the military. Mattis was careful in describing how he would use America’s military might, saying he views force to be a “last resort” that the U.S. can avoid by deterring adversaries with strong alliances and diplomatic leadership:

America has two fundamental powers. One is the power of intimidation. America will defend itself and this experiment in democracy. And the other power that perhaps we have used less in recent years is the power of inspiration. That has to be deployed at times just as strongly.

Central to that power, Mattis said, is adequately funding the military so that it has the best equipment and weaponry.

Mattis warned that because of spending cuts mandated by a budget device known as sequestration, the U.S. may lack the military strength to easily confront Russia and other adversaries, and to manage conflicts such as the war in Afghanistan and the military campaign against the Islamic State terrorist group, or ISIS, in Syria and Iraq.

The Budget Control Act of 2011, which set spending caps, cut a projected $487 billion from defense spending over a decade.

Yet at the same time, Mattis concurred with Sen. David Perdue, R-Ga., who asked whether Mattis agrees the national debt is the greatest threat to national security.

“I understand the need for solvency and security. No nation has maintained its military power if it did not maintain its fiscal house,” Mattis said, adding:

At the same time, this country needs to be prepared to defend itself. I believe we can afford survival. I don’t believe in a mathematical calculus that makes Congress spectators as salami-slice cuts come in and you [Congress] don’t have control of it.

Here are other highlights from Mattis’ confirmation hearing, in which the retired four-star Marine general described his policy vision on issues he would encounter as defense secretary:

Iran Nuclear Deal

Mattis reportedly left his last job as leader of U.S. Central Command, which oversees military operations in the Middle East and Southwest Asia, because he disagreed with the Obama administration on how hawkishly to approach Iran.

In the past, Mattis has said Iran is a greater threat than terrorist groups such as ISIS or al-Qaeda.

But in the confirmation hearing, Mattis did not advocate canceling the nuclear deal the Obama administration and other foreign powers negotiated with Iran.

“I think it is imperfect arms control agreement—it’s not a friendship treaty,” Mattis said. “But when America gives her word, we have to live up to it and work with our allies.”

Israeli-Palestinian Conflict

Bolstering relations with Israel, Mattis said, could help settle a turbulent Middle East.

“We have to restore a better relationship with Israel and Arab allies,” Mattis said. “There is a sense on their part we are indifferent to the security situation they face.”

Mattis said he favors a two-state solution to the Israeli-Palestinian conflict and he did not commit to Trump’s campaign pledge to move the U.S. Embassy from Tel Aviv to Jerusalem.

Women in the Military

Sen. Kirsten Gillibrand, D-N.Y., pressed Mattis on whether he supports Obama administration decisions to open combat positions to women and to lesbian, gay, bisexual, and transgender Americans.

While stressing that having the most “lethal” fighting force would be his priority, Mattis said he would not try to roll back Defense Department policies in those areas.

“I have never come into any job with an agenda of changing anything,” Mattis said. “I come in assuming the people before me deserve respect for the job they did and decisions they made. I believe military service is a touchstone for people of every stripe.”

Defeating ISIS

Mattis said he is confident in ongoing U.S.-assisted military operations to take back from ISIS the major cities of Mosul, Iraq, and Raqqa, Syria.

But he said he would undertake a more “accelerated campaign” to defeat ISIS, understanding that the military effort is only part of the battle.

“There has to be a military defeat, but it has to be a broader approach,” Mattis said. “You need to go after recruiting and fundraising as well. The most important thing to know when you get into a shooting war is how you want it to end.”