A Stockholm court has acquitted the Swedish ex-ambassador to China, who had been accused of going beyond her remit to have talks with a foreign power.
Anna Lindstedt had faced a possible jail term for brokering a meeting to secure the release of a Hong Kong bookseller jailed in China.
Chinese-Swedish Gui Minhai is serving a 10-year sentence for "illegally providing intelligence overseas".
He has written unflattering profiles of Chinese leaders.
The meeting brokered by Ambassador Lindstedt was between his daughter Angela Gui and two Chinese businessmen in January 2019.
Rejecting the charges, the district court decided that the ambassador had acted in line with her mission as ambassador. It added that the two businessmen at the meeting could not be considered to have represented a foreign power.
In court, Ms Lindstedt had said "it is unreal, not to say Kafkaesque to stand accused of crimes against national security".
She was the first ambassador to face charges in Sweden in 200 years.
The prosecutor argued that she had acted in violation of Swedish foreign policy by arranging the negotiations.
What is the background?
In February 2019 Anna Lindstedt was recalled from China as ambassador after she was accused of brokering an unauthorised meeting at the Sheraton Hotel in Stockholm between Angela Gui and the two Chinese businessmen, said to have connections to the Chinese Communist Party.
Before the meeting Ms Gui had been campaigning for her father's release, and then said she had been invited to the meeting by Ms Lindstedt, who told her "there were some businessmen she thought could help, and that they wanted to meet me in Stockholm".
She alleged that during a meeting over two days one of the businessmen had pressed her to accept a deal involving a "few years" in jail if she stopped publicising her father's detention.
Ms Gui also alleged that the ambassador had backed the plan, warning her that if her publicity continued, China might "punish Sweden".
Anna Lindstedt denied wrongdoing and said nothing publicly. However, she argued that she emailed the foreign ministry in Stockholm about the meeting and as ambassador had appropriate powers to act.
She also denied that the meeting with the two businessmen constituted talks with China.
The foreign ministry says it sent a message to her to drop the case but the former ambassador says she never received it.
Who is Gui Minhai?
A Hong Kong bookseller with Swedish citizenship, he went missing while on holiday in Thailand in 2015 and later turned up on Chinese state television confessing to a 2003 drunken driving incident.
Four other Hong Kong booksellers, who were also involved in publishing racy accounts of Chinese leaders, disappeared around the same time and later appeared in custody in mainland China.
Gui Minhai was released in 2017 but then detained on a train to Beijing with Swedish diplomats and jailed in February this year on charges of illegally providing intelligence abroad.