Australia has a split personality when it comes to China: Government officials stress the importance of their strategic alliance with the United States, even if it upsets Beijing. But business leaders argue that Australia must accommodate the reality of China’s overwhelming economic power in Asia.

It’s an awkward straddle for Australia, as its security and economic interests diverge. “It has often been noted that this is the first time in our history that our No. 1 trading partner is not an ally,” notes Foreign Minister Julie Bishop in an interview here.

The Chinese “have raised scenarios where Australia could be forced to choose between the U.S. and China,” Bishop explains. “This is generally accompanied by warnings that Australia will need to choose its friends carefully, implying that economic partners may be more important than strategic allies.”

A visitor here encounters the debate about how to deal with China’s growing power in almost every conversation. It’s a painful dilemma: Australia has profited enormously from China’s rise, posting 25 years of uninterrupted economic growth, fueled partly by its exports to China. But Australia also has a deep affinity for America and prides itself on an unblemished record of supporting the United States militarily, in good times and bad.

This balancing act became more prominent this month when the government decided to block, on national-security grounds, Chinese companies’ proposed purchase of Ausgrid, the utility that provides power in the state of New South Wales, which includes Sydney. The Chinese Embassy gave a tart statement to the newspaper the Australian saying that it was “highly concerned” that its investment had been rejected.

Many Australian business leaders are unhappy, too, about spurning the region’s economic superpower. At a dinner here Monday that included some prominent executives, there was near-universal criticism of the government’s Ausgrid decision, which several argued was driven by needless fear among the intelligence establishment about Chinese ownership of part of Australia’s power grid.

Prime Minister Malcolm Turnbull illustrates the twin pull: In his business career as a lawyer, he worked on many lucrative deals in China. But since taking over last September as leader of the governing Liberal Party (which is conservative, in U.S. terms), he has been a critic of Chinese actions in the South China Sea.

Turnbull argues that the prosperity-security split is a false dichotomy, because Australia can’t have the former without the latter. “Our relationship with the United States is becoming more important, not less, as the center of global economic gravity shifts relentlessly towards Asia,” Turnbull said in a recent speech.

For officials across the Australian government, the potential danger from China is clear. They see a China that, under President Xi Jinping, has increasingly sought regional hegemony. Despite a rejection of its claims in the South China Sea last month by an international arbitration panel, Beijing has essentially won its campaign to create potential military bases on reclaimed islands. Australian government officials fear that China wants to treat the Asia-Pacific region in the same arbitrary way it deals with its own people.

One Australian expert likens China’s military rise to the issue of climate change. It’s a gradual and probably unstoppable process; the question is whether to try to mitigate its effects, by taking tough measures, or simply adapt to the inevitable.

The Turnbull government’s willingness to challenge China seems based on two important assumptions. First, Beijing’s continued rise isn’t as inexorable as it has seemed in recent years. Chinese economic growth is slowing, and leaders are having trouble implementing economic reforms and creating the consumer-driven economy Beijing says it wants. Second, other Asian nations are becoming powerhouses, too. The Indian economy is now growing faster than China’s; Indonesia’s per capita GDP has increased 50 percent in the past decade; and Japan is making a slow comeback.

“What we need to ensure is that the rise of China . . . [is] conducted in a manner that does not disturb the security and the relative harmony of the region upon which China’s prosperity depends,” Turnbull said last year in his first major interview after becoming prime minister.

A poll released this year by the Lowy Institute, a foreign policy think tank that organized my visit to Australia, showed the conflicting pulls on the country. Asked which relationship was more important, 43 percent named the United States, and 43 percent said China.

Australia’s heart and its wallet are in different places. The split may be manageable, but only if the United States remains a strong and reliable ally — an issue that many Australians fear is up for grabs in our November presidential election.

Read more from David Ignatius’s archive, follow him on Twitter or subscribe to his updates on Facebook.