WASHINGTON (Reuters) - Donald Trump’s pick to lead the Pentagon put Russia at the top of a list of threats to U.S. interests on Thursday and told Congress that America must be ready to confront Moscow where necessary, even as he backed Trump’s bid for better relations.

The remarks by retired Marine General James Mattis were the latest by one of Trump’s Cabinet picks that veered away from the president-elect’s campaign rhetoric, which included praise for Russian President Vladimir Putin and pledges to improve ties with him.

Secretary of State nominee Rex Tillerson on Wednesday also expressed views at odds with Trump on key foreign policy issues like nuclear proliferation, trade deals, climate change and relations with Mexico.

Mattis said Russia, China and Islamist militants were presenting the biggest challenge to the U.S.-led world order since World War Two, and called for Congress to lift spending caps undermining military readiness.

“I’m all for engagement but we also have to recognize reality in what Russia is up to,” Mattis said, adding there were a “decreasing number of areas” where the United States might cooperate with Moscow.

Asked about the main threats to U.S. interests, Mattis said: “I would consider the principle threats to start with Russia.”

Mattis said he wanted to meet with the new Trump national security team to “craft a strategy to confront Russia for what it’s done,” when questioned about the possibility of new U.S. sanctions.

Due to enter the White House in eight days, Trump on Wednesday acknowledged that Russia likely hacked the Democratic National Committee and emails of top Democrats during the 2016 presidential election campaign, a conclusion reached by U.S. spy agencies.

Mattis cited Russian involvement in hacking and information warfare among the challenges posed by Moscow. Others include treaty violations, destabilizing activities abroad and “alarming messages from Moscow regarding the use of nuclear weapons.”

STRONG BACKING FOR NATO

He also accused Russia of trying to undermine NATO. Unlike Trump, who appeared to question the alliance during his campaign, Mattis strongly embraced it -- calling NATO central to America’s defense.

“We recognize that he (Putin) is trying to break the North Atlantic alliance,” Mattis said.

Senator John McCain, the Republican chairman of the committee, said he “could not be happier” about Mattis’ nomination. He warned sternly against optimism about engaging with Putin.

“Putin wants to be our enemy. He needs us as his enemy. He will never be our partner,” McCain exclaimed.

Mattis also singled out China for its activities in the South China Sea, where it has been building man-made islands with anti-aircraft and anti-missile batteries.

Together with Russian activities and the threats of Islamist extremists, Mattis said China was part of mounting assault on global stability, and the relationship with Beijing needed to be carefully managed.

“I think it (the world order) is under the biggest attack since World War Two, sir, and that is from Russia, from terrorist groups, and with what China is doing in the South China Sea,” he said.

Slideshow ( 4 images )

Mattis railed against defense spending caps imposed by Congress and, when pressed, said he did not believe the U.S. military was strong enough to properly deter potential adversaries.

WAIVER NEEDED

Mattis, who retired from the military in 2013, is technically ineligible for the job since he has not been a civilian for at least seven years. That means Congress would need to grant him a waiver, something it has not done since 1950, but appears inclined to do now.

After Mattis’ testimony, the waiver cleared its first hurdle in Congress when the Senate Armed Services Committee approved it. The full Senate later backed the waiver by an overwhelming 81-17 vote, reflecting the strong support Mattis enjoys in Congress.

Slideshow ( 4 images )

Mark Cancian, a senior adviser at the Center for Strategic and International Studies, said he expected bipartisan support for Mattis would help him overcome limited opposition.

“The other thing he has going for him is that he may be a restraint on some of Trump’s more extreme impulses,” Cancian said.

Mattis, 66, has tried to persuade Trump privately against the use of waterboarding, which simulates drowning, as an interrogation tactic. Top U.S. officials, many lawmakers and human rights groups have denounced waterboarding as torture.

Trump’s pick for CIA director took a similar line during his confirmation hearing on Thursday, saying he would stand firm if necessary against Trump on the issue of so-called enhanced interrogation techniques.

Mattis was fiercely critical of Iran, cautioning that Tehran’s “malign influence” in the region was growing.

“Iran is the biggest destabilizing force in the Middle East and its policies are contrary to our interests,” Mattis said in written responses to the committee.

Still, Mattis did not echo Trump’s campaign threat to rip up a nuclear deal between Iran and world powers, under which Tehran agreed to curb its nuclear program in return for relief from economic sanctions. Mattis said the deal was imperfect but that the United States should uphold it.

“When America gives our word, we have to live up to it,” Mattis said.