Former prime minister Paul Keating has launched an extraordinary attack on Australia’s spy chiefs, calling them “nutters” and urging Bill Shorten to sack them to improve relations with China if he wins the election.

Mr Keating suggested security agency ASIO was running Australia’s foreign policy under the Coalition and predicted a Labor government would “make a huge shift” in Australia’s China strategy by accepting Beijing’s right to express its growing power.

Mr Keating was speaking at Labor’s campaign launch, where Mr Shorten described Mr Keating during his speech as “a wonderful source of advice to me and my colleagues”.

Former prime minister Paul Keating arrives at the Labor campaign launch. Credit:AAP

But a Labor campaign spokesperson appeared to distance the party from Mr Keating's remarks, saying: "Labor has great respect for our security agencies. We always work co-operatively with them in the national interest."