Keating, who was prime minister from 1991 to 1996, told Australia’s National Press Club that China was not a “contiguous threat” to his country.

He also criticized the recent AUKUS submarine deal struck by Australia, the U.K. and the U.S.—suggesting that the eight subs Australia intends to build will not be an effective form of defense.

“Taiwan is not a vital Australian interest. Let me repeat that, Taiwan is not a vital Australian interest,” Keating said.

“We have no alliance with Taipei, none. There is no document you can find.”

Keating added that Australia would have no obligation to assist the U.S. if the country went to war with China over Taiwan.

“We are committed to ANZUS for an attack on U.S. forces, but … not an attack by U.S. forces, which means Australia should not be drawn, in my view, into a military engagement over Taiwan, U.S.-sponsored or otherwise,” he said.

ANZUS—the Australia, New Zealand and United States Security Treaty signed in 1951—requires the parties to consult each other if they’re threatened and to “act together to meet the common danger.” This does not necessarily mean Canberra would assist Washington militarily.

Keating said China was “in the adolescent phase of their diplomacy” with “testosterone running everywhere,” but added that Australia would have to engage with Beijing nonetheless.

China claims Taiwan as part of its territory. Most of the world’s governments, including the U.S., do not recognize the island as an independent nation, but Washington has long provided military assistance to Taipei.

Keating also took aim at the AUKUS partnership under which Australia will acquire at least eight nuclear-propelled submarines. The first of these vessels may not be ready until 2040.

The former prime minister said Australia’s policy was “at odds with its geography” and the country was “still trying to find our security from Asia rather than in Asia.”

“Here we are running to Cornwall to find our security in Asia. I mean, really,” Keating said.

Australian Prime Minister Scott Morrison finalized the AUKUS agreement at a meeting of the G7 in Cornwall, southwest England, in June.

Keating also appeared skeptical about the impact of the submarines.

“Eight submarines against China when we get the submarines in 20 years’ time—it’ll be like throwing a handful of toothpicks at the mountain,” he said.

He added that the French government had been treated “appallingly” over AUKUS. Australia canceled a $90 billion deal with France to purchase 12 submarines that would not be nuclear-propelled, in favor of the agreement with the U.S. and U.K.

The French government protested the decision and it has led to a diplomatic spat between France and the AUKUS nations.

Keating added that China wanted “respect for what they have created.”

“China does not represent a contiguous threat to Australia,” he said. “China is not about turning over the existing world order. It only wants to reform it, and it wants to reform it only because of its scale.”