James Mattis, Donald Trump's nominee to head the Pentagon, testified Thursday that he supports efforts to engage with Russia but doubted the two countries would find ways to cooperate.

"I have very modest expectations about areas of cooperation with Mr. (Vladimir) Putin," Mattis said.

Trump has spoken somewhat admiringly of the Russian leader and suggested the two countries could cooperate in fighting the Islamic State.

Mattis faced mostly polite questioning during a confirmation hearing before the Senate Armed Services Committee, suggesting his nomination will not face serious opposition in the Senate.

Democratic leaders expressed hope that Mattis, a blunt-talking retired Marine four-star general, would be a moderating influence on Trump, whose controversial statements and tweets have fueled concerns about his character.

"You will help oversee national security policy for a president who lacks foreign policy and defense experience and whose temperament is far different from prior presidents," Sen. Jack Reed, D-R.I., told Mattis. "Many Americans, and many in this body on both sides of the aisle, are rightly concerned about how he may respond when he is tested by Russia, Iran, North Korea and other transnational threats such as cyber."

Mattis, a combat leader with more than four decades of uniformed service, is a departure from most recent Defense secretaries, who came from the ranks of civilian government service or politics.

The Republican-led Senate passed a special waiver 81-17 Thursday to allow Mattis to run the Pentagon, since federal law requires a seven-year gap between retirement from the military and assuming the Cabinet post. The statute was designed to safeguard the principle of civilian control over the military. The last retired general to head the Defense Department was George Marshall in 1950.

The House Armed Services Committee also backed the waiver in a 34-28 vote. The full House is to vote Friday.

Mattis described growing global threats and said the U.S. armed forces must remain the best led and "most lethal" in the world, admitting the nation has "shrunk our military capability."

Mattis said there are "an increasing number of areas where we will have to confront Russia," adding that Putin is "trying to break" NATO.

More broadly, threats from Russia, China and global terrorism represent the biggest threat to world order since World War II, he said.

Mattis faced questions from lawmakers about the integration of women into the infantry and other "combat arms" jobs.

Women have served extensively in combat in Iraq and Afghanistan, but until recently, they have been barred from some "combat arms" jobs, such as the infantry.

Under the Obama administration, Defense Secretary Ash Carter ordered that all jobs, including the infantry, be open to women.

Sen. Kirsten Gillibrand, D-N.Y., cited speeches Mattis made expressing concerns about allowing women into the infantry, a physically demanding job that requires living for long periods of time under primitive conditions.

Mattis said he was coming into the job without preconceived ideas. "I have no plan to oppose women in any aspect of our military," Mattis said.

He said his chief concern was military readiness and the "lethality" of the force, which could suggest he might review some aspects of the policy if it could be shown that it hurt capabilities.

The Marine Corps asked in 2015 for an exemption for its infantry units after a study that showed mixed-gender infantry squads were not as combat-effective as all-male units. Carter denied the exemption request, and the Marine Corps is taking steps to open the infantry to women.

Mattis is revered inside the Marine Corps, where his aggressive style and frank conversation were prized by young Marines. He commanded troops in Afghanistan in 2001 and in Iraq in 2003 and 2004. He served as an infantry battalion commander during the Persian Gulf War in 1990-91.

He has proved himself in broader roles where diplomacy is required. He headed U.S. Central Command, which oversees operations in the Middle East, and met frequently with leaders throughout the region.

Mattis retired in 2013, leaving his position as head of Central Command amid reports the White House squeezed him out.

Asked about the reports, Mattis told USA TODAY at the time that he provided the unvarnished truth to his civilian leadership. "The idea that you should moderate it before you give it to them is not showing respect to your civilian leadership," Mattis said.