China arrested an Australian writer for alleged spying, Australia’s government said, in a case that exacerbates tense relations between the two countries.

Yang Hengjun, a blogger and spy novelist who had been in custody for the past half-year, was formally arrested in China on Aug. 23 on suspicion of committing espionage, Australian Foreign Minister Marise Payne said Tuesday. If eventually convicted at trial, Mr. Yang could be forced to serve a long prison sentence.

“Dr. Yang has been held in Beijing in harsh conditions without charge for more than seven months. Since that time, China hasn’t explained the reasons for Dr. Yang’s detention, nor has it allowed him access to his lawyers or family visits,” Ms. Payne said in a statement. “We have serious concerns for Dr. Yang’s welfare, and about the conditions under which he is being been held.”

Mr. Yang was born in China and once worked for the Foreign Ministry before emigrating to Australia. On social media, he has been at times a sharp-tongued critic of China’s ruling Communist Party.

On Tuesday, Ms. Payne said if Mr. Yang is being held for his political beliefs, he should be released.