TOKYO/BANGKOK -- Thailand and China are pressing foreign businesses into service as the countries cope with the coronavirus outbreak, illustrating a risk of relying too heavily on Asia as the world's factory.

Koken, a Japanese maker of professional-use masks, was unable to export its product from Thailand for two weeks due to government restrictions.

In China, authorities have ordered factories to shift production to protective suits and masks, including at sites that supply foreign brands such as Japan's Fast Retailing, parent of the Uniqlo clothing chain.

Other foreign companies have faced restrictions or mandates as well. The Wall Street Journal reported this month that Canadian mask maker Medicom Group was ordered to sell output from its Shanghai factory to the local government. Czech mask maker Respilon has experienced a breakdown in its supply chain due to China's restriction on mask exports, German media outlet DW.com reported.

Orders to sell or give their output to the state amid the health crisis were unexpected for many businesses.

"The notice came out of the blue, and we were very surprised," a Koken spokesperson said.

Thailand's Commerce Ministry said in an early February letter that it would take "control" of mask exports. All mask producers were ordered to submit their export requests to the government for consideration on a case-by-case basis.

The country sought to prioritize domestic supply amid a serious shortage, but the move sparked anxiety for many foreign businesses that have a Thai production base.

Siam Koken, Koken's subsidiary in Thailand, was unable to export masks to Japan for two weeks after the ministry's announcement. The unit produces N95 masks for medical use, exporting all the output to Japan.

Thailand eased the restriction later in February, and Koken said Thursday that it had resumed mask exports. But sources say the Thai government relaxed the rule on the condition that Siam Koken spare a certain amount of masks for domestic use.

Wichai Pochanakit, director-general of the Thai Department of Internal Trade, told the Nikkei Asian Review that easing the rule is discussed "case by case" to ensure that "the export will not cause any domestic shortage." The export suspension tentatively is to last through June.

Koken formed the Thai unit in 2012, choosing the country as its only overseas production base for masks because of its cheaper labor and pro-Japan attitudes, a representative for the company said. Japan ranks first in foreign direct investment into Thailand, accounting for 31% of the total.

Even in Japan, electronics maker Sharp has decided to produce masks in response to government requests, making it the first domestic manufacturer to cross industrial lines.

Asia has attracted many foreign companies that seek cheaper labor and easier access to China. But the recent state interventions shed light on the risks of increasing dependence on Asia for production.

Experts say the turbulence over mask supplies has demonstrated to many business leaders the importance of diversifying their production bases.

"For businesses, it has never been more important to diversify production bases and the supply chain than now," said Satoshi Akao, senior manager at Deloitte Tohmatsu Group who works in Thailand. "It is not enough to diversify risk if you only put your supply chain in Asia."

Takashi Nomura of the Shanghai office for Nishimura & Asahi, Japan's largest law company, said businesses have no choice but to obey such orders in a state of emergency like the coronavirus outbreak.

"What happened after the coronavirus is quite unusual, and it is extremely difficult for businesses to predict such situations and take preventive measures," Nomura said.

"It is very difficult to say whether the current measures that are taken by government comply with the 'rule of law,'" Nomura said. But some measures are "likely to be justified to protect their own people in a state of emergency." Atsuomi Obayashi, a professor at Keio Business School in Japan, said that businesses must assume that state intervention can occur during emergencies and prepare for it in normal times.

Unlike China, which has many state-owned enterprises, Japan tends to take more careful measures to prevent claims seeking compensation by the government, Nomura said.

"There is not only the risk of infection," said Masahiko Hosokawa, a professor at Chubu University in Japan. "Foreign businesses also face unpredictable political risks."

Hosokawa said state intervention to prioritize domestic needs threatens to shake Asia's status as the world's factory. Arbitrary government action, even in an emergency, "might result in losing more foreign companies as investors," he warned.