WASHINGTON — South Carolina Gov. Nikki Haley pledged Wednesday at her confirmation hearing to voice U.S. leadership in the world and stand up to Russia if approved as Donald Trump's ambassador to the United Nations.

"When America fails to lead, the world becomes a more dangerous place. And when the world becomes more dangerous, the American people become more vulnerable,” Haley told the Senate Foreign Relations Committee.

When asked about Russia, Haley was unequivocal. "Russia is trying to show its muscle," she said. "We cannot trust them and need to continue to be cautious."

"We need to continue to be strong back, show what this administration will be," she said. "We are not OK with what happened in Ukraine and Crimea and what is happening in Syria. But we do need their help in ISIS," she said, using an acronym for the Islamic State.

Sen. Ben Cardin of Maryland, the ranking Democrat on the committee, asked if Russia has any legitimacy in Ukraine's Crimea province, and whether she supports sanctions on Russia for its actions in Ukraine.

Haley agreed that Crimea is part of Ukraine and not Russia. "We have to make that very clear to them," she said. "Russia has to make positive actions before we lift any sanctions on Russia."

Haley was also asked about Trump’s comments about NATO being obsolete, cooperating more with Russia and China being not helpful in dealing with North Korea.

“Any comments the president-elect has made are his comments,” Haley said. “We’re still going to need those countries. We need China’s help when it comes to North Korea. When we disagree with them, we should not be afraid to say we disagree with them. When we need to work with them, we need to work with them.”

Haley called the U.S. abstention last month on a U.N. Security Council resolution condemning Israel's settlement activity, "a terrible mistake" because it allowed the measure to pass without an American veto. "I will never abstain when the the United Nations takes any actions to counter the interests and values of the United States," she said.

Haley was pressed on Israel’s expansion of settlements, the key issue in the U.N. Security Council resolution that the U.S. allowed to pass in December. She said she supports the bipartisan policy that calls on Israel not to expand settlements in the West Bank on land Palestinians seek for a future state.

“I do understand how they (Palestinians) think they will hinder peace,” she said. But “we need to let the two parties decide those issues among themselves.” “For the U.N. to insert itself I believe is wrong,” she added.

Haley disagreed with Trump on several issues during her confirmation hearing.

She said she was against a blanket ban on Muslim immigration, and said “the president-elect corrected his position on that.” She also disagreed with a proposed U.S. Muslim registry, saying it would be unconstitutional.

She said she recognizes the importance of refugee programs, describing interpreters who helped ensure the safety of her husband’s National Guard unit while deployed to Afghanistan, who were granted asylum because their lives would have been at risk if they’d stayed in Afghanistan.

But asylum for refugees from Syria should be treated differently, she said.

“FBI Director (James) Comey told me we don’t have enough information to vet refugees from Syria,” Haley said. “That’s when I decided we cannot take refugees from Syria and ensure the security of the citizens of South Carolina.”

Sen. Chris Murphy, D-Wis., asked Haley if she expects Trump’s views to change after two years of sending muddled messages and calling for drastic change in U.S. foreign policy. “That’s how an administration works,” she responded. “You surround yourself with people who don’t just say ‘yes.’ And what I know about the president-elect is he will listen.”

Sen. Tim Kaine, D-Va., asked Haley if she supports backing out of the nuclear deal negotiated by the Obama administration with Iran and five other world powers.

Haley said no. But her answer led to some dispute among senators.

“More beneficial at this point is to look at all the aspects of the Iran deal, are they in compliance?” she said. “We need to hold them accountable.”

Haley faulted the agreement as giving a state-sponsor of terrorism “a path” to a nuclear weapon, because many restrictions in the agreement lift after 10 years.

Kaine depicted Haley’s response as ill-informed, saying Iran agreed in the first paragraph of the agreement “to never obtaining a nuclear weapons program.” And many restrictions remain after 10 years, he said.

In fact, the agreement allows Iran to expand its nuclear program after a decade, with more numerous and more efficient fuel making technology that would make it easier for Iran to hide a secret weapons program if it chose to cheat, according to experts, such as the Institute for Science and International Security.

Sen. James E. Risch, R-Idaho, said Kane’s assessment of the Iran agreement “is 180 degrees at odds with reality.”

“Your characterization that we’re going to give hundreds of billions of dollars to them … is absolutely right,” Risch said.

The United States currently contributes 22% of the U.N. organization’s budget, and Haley questioned during the hearing whether such a large investment is worthwhile.

“We are a generous nation,” Haley said. “But we must ask ourselves what good is being accomplished by this disproportionate contribution. Are we getting what we pay for?”

When pressed further on cutting U.S. spending to the U.N., Haley admitted she did not believe in a "slash and burn" of the U.N. but instead would be reporting on whether certain U.N. programs are currently working.

Cardin told Haley earlier that while he is "concerned about your lack of foreign policy experience," he has been impressed by her actions as governor. "One area I was particularly impressed by your leadership as governor is your call for the removal of the Confederate flag from the South Carolina State House," Cardin said.

Haley, 44, started out talking about her "American story," born to a middle-class Indian family and growing up in South Carolina, where the color of her skin was "too dark to be considered white and too light to be considered black." Haley, backed by the Tea Party, made history in 2011 when she took office as the first female governor of South Carolina. She has served two terms as governor. Her husband Michael was deployed to Afghanistan's Helmand province in 2013 as a member of the Army National Guard.