China said the case involved state secrets and so could not be heard in open court. Yang, an Australian citizen born in China, wrote about Chinese and US politics online as a high-profile blogger and also penned a series of spy novels before his detention two years ago.
Ambassador Graham Fletcher said it was "deeply regrettable" that he was unable to enter the Beijing No. 2 Intermediate People's Court despite a bilateral consular pact allowing for diplomatic attendance at such hearings.
He told reporters outside the court that Australia had long-standing concerns about a lack of transparency in Yang's case and "have concluded it is an instance of arbitrary detention."
Chinese foreign ministry spokesman Zhao Lijian told a regular press briefing that "no one is allowed to sit in on the trial" due to the nature of the case against Yang. Zhao said the court would announce its verdict at a later date.
"China firmly rejects Australia's groundless moves to disrupt China's handling of the case in accordance with the law and to meddle in our judicial sovereignty," he said.
Human Rights Watch said it was "alarming" that Chinese authorities had denied observer status to Australian diplomats.
Diplomatic ties between the two nations have deteriorated sharply since Yang was detained, with China imposing trade sanctions on produce from Australia and reacting angrily to its call for an international inquiry into the origins of the coronavirus, as well as its 5G ban on telecoms giant Huawei.
Details of the Yang case have been shrouded in secrecy, with no information released on which espionage agency he is alleged to have acted for. If convicted Yang faces a jail term of 10 years or more on charges of endangering national security.
Human rights lawyers Mo Shaoping and Shang Baojun represented Yang at Thursday's proceedings, which continued into the afternoon as his lawyers responded to the charges, a friend of Yang's with knowledge of the matter told Reuters.
Yang's wife, Yuan Xiaoliang, was unable to attend the court hearing after her application was rejected, friends told Reuters.
She hasn't seen Yang since the couple were stopped at the southern airport of Guangzhou in January 2019 after arriving from New York, where they lived.
In previous messages passed to consular officials, Yang has denied the espionage accusations against him and vowed not to confess to something he had not done.
In his last message to family and friends in Australia before the hearing, Yang said in March that his health had deteriorated but he had "no fear."
"If someone wants to take revenge on me for my writings, please explain to the people inside China what I did, and the significance of my writing to people in China," he said, according to a copy of the message seen by Reuters.
Australia's Foreign Minister Marise Payne told ABC radio: "We are not interfering in China's legal system. The concerns we have raised are legitimate ones."
Yang's January 2019 detention came at the same time as a Chinese police crackdown on potential foreign interference and "color revolution."
Yang had previously been arrested in 2011 in China on suspicion of being involved in the short-lived "Jasmine Revolution" protests and released after three days.
He wrote in a letter to his supporters in Australia after he was released that he had once worked for the Chinese state security agency in Hong Kong and Washington, before migrating to Australia in 1999. – Rappler.com