At his confirmation hearing to become defense secretary Thursday, Retired Gen. James Mattis defended the importance of NATO, called Russia a “principal threat” facing the U.S. and differed from President-elect Donald Trump on whether Jerusalem should be considered the capital of Israel.

After his testimony before the Senate Armed Services Committee, the panel approved a waiver that said Mattis could serve as secretary of defense, if confirmed by the Senate. Current law limits the appointment of a defense secretary within seven years of relief from duty.

The Senate overwhelmingly approved the waiver later in the day in a 81-17 vote, with 16 Democrats opposing it including possible 2020 presidential contenders: Sens. Kirsten Gillibrand of New York, Elizabeth Warren of Massachusetts, Bernie Sanders of Vermont and Cory Booker of New Jersey.

RUSSIA

During the hearing, Mattis, 66, described Russia as a “principal threat” facing the U.S. and agreed with President-elect Donald Trump’s view that he’d like to see engagement with its government. At the same time, he characterized Russia as a U.S. adversary and expressed doubt that the Trump administration can achieve positive relations with it all the time.

Get Breaking News Delivered to Your Inbox

“I’m all for engagement but we also have to recognize reality and what Russia is up to and there’s decreasing number of areas where we can engage cooperatively and increasing number of areas where we’re going to have to confront Russia,” Mattis said. “I have very modest expectations about areas of cooperation with Mr. [Vladimir] Putin.”

Mattis declined to give a straight answer on maintaining or increasing U.S. sanctions against Russia, and only said he’d like to meet with Mr. Trump’s new national security team and “craft a strategy to confront Russia.”

Speaking about the build-up of Russia’s military in the Arctic, Mattis said it’s “not to our advantage” to leave any of those areas of the world where U.S. efforts are absent. Asked what Russia is trying to achieve in the Arctic, Mattis said, “I don’t know” and he added that the U.S. must ensure that Russia doesn’t expand those efforts to dominate the region.

NATO

Mattis, who served as NATO’s Supreme Allied Commander of Transformation from 2007 to 2009, called the alliance “the most successful military alliance probably in modern history, maybe ever.” Mattis dodged questions about whether he’s concerned with the president-elect’s criticisms of the alliance, except he said Mr. Trump has “shown himself to be open.”

As part of his opening statement, Mattis said that Russia poses a threat to NATO.

“I think right now the most important thing is that we recognize the reality of what we deal with Mr. Putin and we recognize that he is trying to break the North Atlantic alliance and that we take the steps -- the integrated steps, diplomatic, economic, military and the alliance steps, the working with our allies to defend ourselves where we must,” he said.

ISRAEL

Mattis was asked by Sen. Lindsey Graham, R-South Carolina, to identify the capital of Israel and Mattis responded that it’s Tel Aviv because that’s where its government officials are based.

Asked if Jerusalem is Israel’s capital, Mattis deflected and said he is sticking with longstanding, current U.S. policy which is that the U.S. does not recognize Jerusalem as Israel’s capital, and that its final status should only be determined by direct negotiations between the involved parties.

Mr. Trump, however, wants to break longstanding policy and move the U.S. embassy in Israel from Tel Aviv to Jerusalem.

Mattis also seemed open to the idea of providing U.S. military assistance as part of a future peace agreement between Israel and the Palestinians.

“I’d have to look at the specific commitment,” Mattis said. “I don’t have a going-in prohibition to engaging along those lines.”

Asked if it would be an appropriate use of the U.S. military, which Sen. Tim Kaine, D-Virginia, said would be similar to the assistance provided on the Israel-Egypt border, Mattis said, “If we can contribute, certainly, it’s something we should look at.”

ISIS

Mattis stressed during his hearing that the military’s lethal force must be strengthened in order to defeat the Islamic State in Iraq and Syria (ISIS). Asked if the U.S. military currently has a strategy to regain control of Raqqa, Mattis said, “I believe we do, sir. However, I believe that strategy needs to be reviewed and perhaps energized on a more aggressive timeline.”

On the strategy to defeat ISIS overall, Mattis said that the U.S. must “deliver a very hard blow against ISIS in the Middle East.” He said it must be an “integrated strategy” so that “you don’t squeeze them in one place and they develop in another.” The strategy, he said, should focus on their recruiting and fundraising, in addition to direct military measures.

WOMEN, LGBT RIGHTS IN MILITARY

Several Democrats grilled Mattis on whether he plans to roll back the Obama administration’s policy to allow women into infantry and combat positions in the military. Mattis didn’t explicitly say he agrees with that policy, but he also cautioned that he has no plans to roll anything back.

“Senator, I’ve never come into any job with an agenda, a preformed agenda,” Mattis said. “I’m not coming in looking for problems.”

Pressed again on whether he plans to oppose women in combat positions, Mattis said, “I have no plan to oppose women in any aspect of our military.”

Mattis was also asked if openly serving gay servicemembers are undermining U.S. forces and he said that he believes the U.S. must stay focused on improving the military’s lethal abilities.

“I’ve never cared much about two consenting adults and who they go to bed with,” he added.