BEIJING — An Australian writer who was detained in China last week is suspected of “endangering national security,” the Chinese Foreign Ministry said on Thursday, confirming that he is the third foreigner to have been detained on that ominous charge since last month.

The writer, Yang Hengjun, arrived in the southern city of Guangzhou on Friday on a flight from New York, despite warnings from friends about the risks of returning to China, where he was born, at a tense time. Officers took him away before he and his wife and child could catch a connecting flight to Shanghai, according to friends of Mr. Yang who spoke to his family.

The Australian government confirmed on Wednesday that Mr. Yang, 53, had been detained. But the severity of the charges against him was unclear until Thursday, when Hua Chunying, a spokeswoman for the Chinese Ministry of Foreign Affairs, told reporters in Beijing that Mr. Yang was suspected of crimes related to “state security.” She referred to Mr. Yang as Yang Jun, and later said that was his officially registered name.

Beijing’s state security bureau detained Mr. Yang “on suspicion of criminal activities endangering national security,” Ms. Hua said at a regularly scheduled news briefing. “Currently, the case is still under investigation under the law.”