SYDNEY, Australia — In a recent online discussion, Bill Shorten, the front-runner in the race to be Australia’s next prime minister, left little doubt about where he stood on the politically delicate issue of relations with China — and where the world’s other superpower fit into his calculus.

“If I’m P.M., I welcome the rise of China in the world,” he said in a post on the Chinese social media platform WeChat that was aimed at Australia’s 1.2 million voters of Chinese descent. Mr. Shorten, the leader of the center-left Labor Party, added that he saw China not as a “strategic threat,” but as a “strategic opportunity.”

Those words put him directly at odds with the Trump administration, which has sounded alarms about China’s global ambitions and tactics. But Mr. Shorten, while acknowledging that Australia would always be an ally of the United States, declared that it was time for his nation “to stand on its own feet and think for itself.”

If Mr. Shorten’s party prevails in Saturday’s election, his embrace of China would represent a significant break from the current conservative Australian government, which has taken a harder line toward Beijing’s growing influence in the country and whose leader, Prime Minister Scott Morrison, is an avowed admirer of President Trump. It could also signify a crack in the united front that the Trump administration is trying to build to check China’s ascent.