WELLINGTON, New Zealand — China has stopped imports of all milk powder from New Zealand and Australia, New Zealand’s trade minister said on Sunday, after bacteria that can cause botulism was found in some dairy products and raised safety concerns that threatened a $9.4 billion annual dairy trade.

The dairy giant Fonterra, which is based in New Zealand, identified eight companies to which it had sold contaminated whey protein concentrate that was exported to China, Malaysia, Vietnam, Thailand and Saudi Arabia, and used in products including infant milk powder.

Nearly 90 percent of China’s $1.9 billion in milk-powder imports last year originated in New Zealand, and economists said that a prolonged ban could produce a shortage of dairy products in China, including infant formula with foreign brands. The problem comes at a time when many parents in China are concerned about the safety of baby formula sold in that country. Many Chinese residents are already taking baby formula back with them when traveling overseas, and officials have begun to limit the amount they can carry.

Australia was caught up in the ban after some of the contaminated whey protein concentrate was exported there before being sent to China and elsewhere.