BEIJING — Until the door of the plane that took her to freedom in Germany closed, they hovered around. They escorted her on the 90-minute car ride from her apartment to the airport. They walked her through a special departure area.

For the past year, China’s formidable security apparatus had guarded, watched and controlled the movements of Liu Xia, 57, widow of China’s most famous dissident, the Nobel Peace Prize laureate Liu Xiaobo, who died of cancer last July under police guard.

Then, out of the blue, a security official telephoned her last week to say she could pick up a passport and leave the country, European diplomats said.

The decision by the Chinese government to release Ms. Liu days before the anniversary of her husband’s death sprang from the passionate interest in her fate by Chancellor Angela Merkel of Germany, who requested Ms. Liu’s release during a meeting with her Chinese counterpart, President Xi Jinping, an unusual move by a Western leader.