Nevertheless, he said, Ms. Lindstedt acted on her own without the necessary support or permission from the Ministry for Foreign Affairs.

The charge can bring a maximum prison sentence of two years under the Swedish Penal Code. A trial date for Ms. Lindstedt has not been set, Mr. Ihrman said. The Swedish public broadcaster SVT reported Monday that prosecutors chose a milder charge than what the government’s security service had sought, “disloyalty when negotiating with a foreign power,” which carries up to a 10-year sentence.

A lawyer for Ms. Lindstedt, Conny Cedermark, said Monday in an email that no crime had been committed. “Arbitrary conduct in negotiation with a foreign power has a series of prerequisites,” he said, and none of them had been met in the case.

Mr. Gui was one of five Hong Kong-based publishers who were abducted and taken to China in 2015 after publishing books that were critical of the Communist Party elite, setting off international condemnation.

After being taken from Thailand to China in 2015, he was formally released two years later but was not allowed to leave the country.

Mr. Gui was again detained early last year, when two Swedish diplomats tried to accompany him on a train from Shanghai to Beijing, where they planned to take him into the Swedish Embassy. But Chinese police officers boarded the train and took him into custody.

They said later that Mr. Gui was suspected of illegally providing state secrets, but gave no details or evidence. Soon after, the Chinese authorities brought Mr. Gui before a group of reporters, and he told them that the Swedish diplomats had wanted to spirit him back to Sweden.