The West’s approach to containing China is akin to its failure to prevent Nazi Germany’s aggression, an influential Australian lawmaker warned, earning a rebuke from Beijing while highlighting the difficulty the U.S. ally faces in weighing its security needs against economic interests.

Andrew Hastie, head of the Australian Parliament’s intelligence committee, used an op-ed published Thursday to sound the alarm about the Chinese Communist Party’s strategic ambitions, saying Beijing’s assertive foreign policy and military expansion pose a fundamental threat.

Hastie, who served in the military before becoming a lawmaker in Australia’s conservative government, said that many Westerners have erred in thinking that China’s economic liberalization in recent decades would lead to greater democratic freedoms.

“This was our Maginot Line. It would keep us safe, just as the French believed their series of steel and concrete forts would guard them against the German advance in 1940,” he wrote in the Sydney Morning Herald and the Age newspapers.

“But their thinking failed catastrophically. The French had failed to appreciate the evolution of mobile warfare. Like the French, Australia has failed to see how mobile our authoritarian neighbor has become.”

Hastie warned that it would be “immensely difficult” to uphold democratic convictions in the face of China’s growing might under President Xi Jinping. Without concerted action, he added, Australia’s sovereignty and freedoms would suffer and its “choices will be made for us.”

Under Xi, China has built up military installations in the disputed South China Sea and increasingly challenged the forces of the United States and its allies in the region. Through its Belt and Road program, it has rolled out loans for infrastructure from the Pacific to Europe and Africa, leaving some nations with unsustainable debts.

Closer to home, Xi has overseen an expansion of the state surveillance apparatus and has been putting pressure on Taiwan, which Beijing regards as a renegade province, through military exercises and efforts to cut off the democratic island’s diplomatic partners.

Australia has a long-standing security alliance with the United States, but its top trading partner is China, whose appetite for raw materials such as coal and iron ore has helped drive Australia’s economic growth over the past quarter-century.

China’s embassy in Canberra criticized Hastie’s remarks, accusing him of having a Cold War mentality and “ideological bias.”

“It goes against the world trend of peace, cooperation and development,” the embassy said in a statement. “It is detrimental to China-Australian relations.”

Prime Minister Scott Morrison said Thursday that Hastie was entitled to his views.

Like other U.S. allies, Australia has been grappling with the risks and rewards of China’s rise. Australia has blocked Chinese tech giant Huawei from its 5G network rollout and recently passed new laws designed to prevent foreign interference in its domestic politics.

Both moves have chilled relations with China of late. Australian officials have stressed that the relationship should not be defined by differences, while acknowledging that there would be some disagreements.

At the same time, the United States has been pressing Australia to take bolder action in countering China’s growing power in the Asia-Pacific region. Australia, though, has said that it would not host U.S. missile bases.

In the op-ed, Hastie said Australia “must be clear-eyed” about the dangers posed by China. “We are resetting the terms of engagement with China to preserve our sovereignty, security and democratic convictions, as we also reap the benefits of prosperity that come with our mutually beneficial trade relationship,” Hastie said.