Swedish prosecutors argued Friday that the country's former ambassador to China overstepped her role and risked national security by trying to negotiate the release of a dissident, as the first day of her trial concluded.

Anna Lindstedt faces up to two years in prison if she is convicted of brokering an unauthorised meeting in January last year when she was ambassador.

She has been charged with "arbitrariness during negotiations with a foreign power".

Lindstedt was trying to secure the freedom of Chinese-born Swedish citizen Gui Minhai, who published gossipy titles about Chinese political leaders in a Hong Kong book shop. He has been in jail in China almost continuously since 2015.

Prosecutor Henrik Olin told the court Lindstedt had "acted outside the bounds of the mandate she had for the consular case".

He said the crime had endangered Sweden's peaceful relations with China.

But defence lawyer Conny Cedermark told the court his client denied the charges.

"She's been looking forward to the trial and she is looking forward, when this trial is over, to being acquitted," Cedermark told AFP after the first day of proceedings wound up.

Gui disappeared while on holiday in Thailand in 2015 before resurfacing in mainland China, where he was put in jail.

A few months after his October 2017 release he was again arrested, this time while he was on a train to Beijing with Swedish diplomats.

In February this year, he was given 10 years in jail on charges of illegally providing intelligence abroad.

Lindstedt helped organise a meeting between Gui's daughter, Angela Gui, and businessmen with ties to Beijing.

Angela Gui wrote in February 2019 on her blog about a "strange experience" where Lindstedt had invited her to Stockholm in January.

Anna Lindstedt, a former envoy in both Vietnam and Mexico, denies overstepping her role
Anna Lindstedt, a former envoy in both Vietnam and Mexico, denies overstepping her role AFP / Jonathan NACKSTRAND

During discussions in the lounge of a hotel in the Swedish capital, in the presence of Lindstedt, she was introduced to the businessmen who claimed they could help secure her father's release.

In exchange, Angela Gui said she was told she "needed to be quiet" and to "stop all media engagement", and later described the tone of the meeting as "threatening".

Sweden's intelligence service launched an investigation after reports of the meeting emerged.

The foreign ministry removed Lindstedt from her post but she has stayed on at the ministry without an assignment.

The ministry has meanwhile maintained that it had no prior knowledge of the meeting, saying Lindstedt acted of her own accord.

Her lawyer is expected to argue that she did inform her superiors of her actions.

Fellow diplomats have meanwhile rallied to Lindstedt's defence, with 21 former envoys writing in a February opinion piece in newspaper Dagens Nyheter that she had acted well within her rights and role as an ambassador.

"I don't think that the ambassador has committed a crime, absolutely not. She tried to do what she should do as a Swedish ambassador -- to solve a complicated consular case between Sweden and China," Sven Hirdman, a former ambassador to Russia and Israel who attended Friday's proceedings, told AFP.

In court, Olin described the tense relation between Sweden and China in recent years, suggesting her actions could have aggravated an already fraught situation.

Criticism from Swedish officials and commentators over Beijing's treatment of Gui Minhai has been a thorn in the side of China, which insists that the matter is an internal affair.

Olin also referred to several incidents in Sweden that have angered China's embassy.

He noted that at the time of the meeting, Lindstedt had already received a new assignment which she was set to start in March 2019 and had expressed frustration about not having been able to secure Gui's release during her tenure.

The trial is set to conclude by June 22.