SYDNEY — Donald Trump's election has triggered an uncomfortable debate in one of America's most loyal allies, Australia, over the future of its alliance with the United States, which has been the foundation of its national security since 1941.

Foreign policy experts, political commentators and the Labor opposition are questioning whether President-elect Trump's apparent ambivalence about foreign alliances — he questioned the worth of NATO during the campaign — means Australia should adopt a more independent foreign policy.

Such a move would be a seismic shift for this country of 25 million people, which has relied on the United States for its security ever since the Japanese threatened to invade during World War II.

After Trump’s victory, former prime minister Paul Keating proposed that Australia “cut the tag” with the United States and form stronger military links with the Association of Southeast Asian Nations, which was founded by Indonesia, Malaysia, the Philippines, Singapore and Thailand in 1967.

An end to the formal military alliance is unlikely. Prime Minister Malcolm Turnbull said Nov. 23 that Australia is America's most influential supporter and that the relationship shouldn't be downgraded. “The fact is that the United States remains our most important strategic and defense ally,” he told Parliament.

But the very existence of the debate illustrates how Trump's victory has triggered concerns about his personality, understanding of world affairs and commitment to long-standing military and diplomatic alliances.

“We should not be naive in this period of uncertainty,” Labor’s foreign affairs spokeswoman, Penny Wong, wrote in the Sydney Morning Herald last month. “Trump's campaign rhetoric expressed views that run counter to what are core values for most Australians. We need to consider a broader range of scenarios than was previously within contemplation.”

As a medium-size economy dependent on access to foreign markets to sell its iron ore, coal, gas, beef, wheat and other commodities, Australia would have benefited from the Trans-Pacific Partnership, a regional trade deal that Trump said he won’t sign.

Watching closely is China, Australia's biggest trading partner, which would love to see Australia loosen its loyalties to the United States. Local supporters of a closer relationship with China are stoking the discussion. Among them is a former foreign minister, Bob Carr, who leads the Australia-China Relations Institute at the University of Technology in Sydney. Beijing is also pushing a rival trade agreement.

“For the first time, there is a huge chasm between the Australian values and those of the U.S. administration — his abandonment of free trade in favor of protectionism, his dumping of support for international action on climate change, his insistence on America first instead of alliances and multilateralism,” Carr said in an interview. “It is a matter of being levelheaded and prosaic and less romantic and idealistic about our American links.”

Uncertainty about the relationship with the president-elect was underscored when Turnbull reached Trump a few days after the election by obtaining his cellphone number from Greg Norman, an Australian ex-professional golfer who lives in Florida. Such calls are normally set up by diplomats.

In return for a promise of military protection, Australia has been a consistent — critics say slavish — adherent of U.S. foreign policy for decades. It committed military forces to the invasion of Iraq under President George W. Bush, still has army trainers in Afghanistan and was an early and enthusiastic contributor to the ongoing U.S. bombing campaign against the Islamic State militant group in Iraq and Syria.

Australian diplomats tend to follow the U.S. position on the Middle East. In 2014, the two countries were the only members of the U.N. Security Council to oppose a demand that Israel end the occupation of the Palestinian territories within two years.