Australian ambassador to China Graham Fletcher walks out of an entrance to the Beijing No. 2 Intermediate People's Court after being refused access to the trial of Yang Hengjun.

Australia’s ambassador to China was denied entry to a heavily guarded Beijing court on Thursday where the espionage case against Australian blogger Yang Hengjun will be heard at a time of worsening ties between the two nations.

Graham Fletcher, Australia’s ambassador to China, attempted to enter the Beijing No. 2 Intermediate People’s Court in line with a two-way consular pact.

“Unfortunately we have just been denied entry to the court. The reason given was because of the pandemic situation but the foreign ministry has also told us it is because it is a national security case therefore we are not permitted to attend it,” Fletcher told reporters outside the court.

“This is deeply regrettable and concerning and unsatisfactory. We have had longstanding concerns about this case, including lack of transparency, and therefore have concluded it is an instance of arbitrary detention.”

Details of the case have been shrouded in secrecy, with no information released on which espionage agency Yang is alleged to have acted for. If convicted, Yang faces a jail term of 10 years or more on charges of endangering national security.

Yang is an Australian citizen born in China who was living in New York immediately before he was detained in China.

Australia has complained that Chinese authorities have not provided “any explanation or evidence for the charges,” prompting a rebuke on Saturday from the Chinese embassy in Canberra, the Australian capital.

Human rights lawyers Mo Shaoping and Shang Baojun will represent Yang when he appears at Thursday’s proceedings in the Beijing court, which was closed to the public.

Police lined the front of the court, their presence extending a block away, and checked the identities of journalists who were refused entry.

Chinese-Australian writer Yang Hengjun (left) and prominent liberal intellectual Mao Yushi.

Yang’s wife, Yuan Xiaoliang, who has been unable to see him since the couple were stopped at the southern airport of Guangzhou in January 2019, applied to attend the hearing but was rejected, friends told Reuters.

In his last message to family and friends in Australia before the hearing, Yang said in March his health had deteriorated but they should not worry because 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.

Fletcher said it was possible a verdict would be given Thursday, or there could be a separate verdict hearing.

Australia’s Foreign Minister Marise Payne said Thursday that Yang’s correspondence with his family in Australia was “deeply moving” and it has been “immensely difficult” for him.

Australia wanted a “transparent and open process,” Payne told ABC radio.

“We are not interfering in China’s legal system. The concerns we have raised are legitimate ones,” she said.

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.

Yang wrote about Chinese and American politics online as a high-profile blogger, and also penned a series of spy novels.

His 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.