For the first time in decades, the actions of a foreign state have taken center stage in an Australian election campaign, analysts say, as China's security pact with the Solomon Islands reverberates into neighbor Australia's domestic politics.

Australian Prime Minister Scott Morrison saw a hawkish stance on China as an electoral strength. But weeks out from an election, his conservative Liberal Party is on the back foot on national security, accused by the opposition Labor Party of bungling diplomacy in the Pacific and making Australia "less secure."

University of Sydney professor Simon Jackman, who studies the major issues for Australian voters in elections, said a perceived threat from another country has not been an election focus since the Cold War.