Retired Marine Gen. James Mattis placed Russia as the top threat facing the United States – especially with its attempts to break up NATO – during his confirmation hearing to become the Pentagon’s top civilian official.

“Russia has chosen to be a strategic competitor” by actions such as seizing Crimea, backing separatists in Eastern Ukraine, trying to intimidate other bordering nations – including NATO allies on the Baltic Sea and Poland – and supporting President Bashar al Assad in the Syrian civil war, he said while testifying Thursday before the Senate Armed Services Committee.

“I’m all for engagement, [but] three are increasing number of areas where we are going to have to confront Russia,” he said.

Committee chairman Sen. John McCain (R-Ariz.) said in his opening statement that “Putin wants to be our enemy.”

When asked whether Baltic allies should have a permanent U.S. military presence, Mattis said, “I do, sir.” He also said he supports the European Reassurance Initiative, which is sending more American armed forces permanently back to the continent and rotating other units through, as well as paying for expanded military exercises to counter Moscow.

Although Donald Trump during the election season questioned NATO’s effectiveness in today’s world, when so few of its members meet the threshold for defense spending – two-percent of gross domestic product – Mattis said “NATO is the most successful military alliance … probably in history.”

“The first time it went into war was when this town [Washington] and New York City were attacked,” he added.

Mattis, in response to another question, said that the president-elect has shown himself open and inquisitive on alliances and partnerships.

“He understands where I stand,” which Mattis testified includes finding common ground with existing allies and “looking for new allies to promote stability. … Nations with strong allies thrive.”

Mattis moved a step closer to confirmation shortly after the hearing ended when the committee on a 24-3 vote approved a waiver of the requirement that a general officer be retired seven years before becoming eligible to serve as defense secretary. He retired in 2013.

The full Congress must also approve the waiver. The only other time the requirement was waived was for Gen. George Marshall in 1950. Approval of the waiver is expected.

However, there are some in the House who are supportive of Mattis as SECDEF but disapprove of the Senate language for the waiver.

“The Senate language we are being asked to approve is also ill-considered and filled with problems that we have not adequately addressed. Unlike the exception for General Marshall in 1950, the bill under consideration does not specify that the exception would apply to General Mattis and only General Mattis. Its vague language would allow the exception to be applied to a former military officer other than General Mattis should he fail to be confirmed by the Senate or if his Presidential nomination is rescinded prior to his appointment to office,” wrote House Armed Services Committee ranking member Rep. Adam Smith (D-Wash.) in a Thursday letter.

“The bill does not remove General Mattis from being subject to the Uniform Code of Military Justice. As a retired military officer, he remains subject to UCMJ jurisdiction, which technically means he could be court-martialed for disobeying orders from the commander-in-chief, disparaging a government official, and any number of other offenses not applicable to civilians. That status could create conflicts with the performance of his duties as Secretary of Defense. These types of conflicts illustrate exactly why civil-military relations are such a major concern.”

The law was passed to demonstrate clear civilian control of the armed forces in the newly created Defense Department following World War II. The committee held a hearing on the waiver earlier this week.

The Senate alone would confirm his nomination. Confirmation is also expected.

Mattis said several times during the three-and-a-half-hour hearing that he understands that his duties as the civilian head of the Pentagon – to shape policy and strategy – were substantially different from those of a combatant commander – to carry out the military aspect of the policy and strategy. He added civilian control also meant congressional involvement in national security policy and strategy.

He said he expected that, as the new administration takes office, he would face immediate challenges beyond Russia. McCain said North Korea’s ballistic missile and nuclear weapons programs “may be the defining crisis of the next president.” The international order of the past 70 years is being subjected “to the biggest attack since World War II.”

Mattis termed the Iranian nuclear pact “an imperfect arms agreement,” adding “It’s not a friendship agreement.” Later in answer to a related question, he said, “When you give your word, you live up to it.” Trump said during the campaign he would re-negotiate the terms.

On China’s militarization of artificial islands in the South China Sea, he said the Defense, State and Treasury departments needed to put together a policy on how to respond, not just militarily.

“International waters are international waters,” he said.

He called for a new look at the strategy in taking Raqqa – the proclaimed capital of the Islamic State – and a hard military blow against the Islamic State in Iraq and Syria to ensure its defeat.

“We’ve got to have an integrated strategy,” he said, not only inside the U.S. government but also with allies and forces such as the Syrian Kurds. Since the election, Trump has suggested he is open to developing a partnership with Russia to defeat the Islamic State.

“I have to assume our credibility will be challenged” in a number of areas after the Jan. 20 inauguration. In facing crises, Mattis said several times in slightly different ways, “we should not simply be turning to the military to answer all our concerns in the world.”

On personnel questions, Mattis said he is open to women serving in all positions in the armed forces and is not coming into office intent on rolling back that decision or those governing sexual orientation.

“Standards are the standards, and when people meet the standards that’s the end of the discussion,” he said.

“I have no plan to oppose women in any aspect of our military.”

He voiced support “absolutely” for the Columbia-class ballistic-missile submarine to replace the Ohio–class now in the fleet, and for buying two Virginia-class attack submarines per year. He said the Lockheed Martin F-35 Joint Strike Fighter would help the United States maintain its strategic edge in fighter aircraft.

“Many of our allies have bet their program [for the future] on the F-35,” he added.