BEIJING — China allowed the widow of Nobel Peace Prize laureate Liu Xiaobo to be freed from house arrest and leave for Berlin on Tuesday, ending an eight-year ordeal that drove the poet into depression and drew intense criticism of Beijing's human rights record.

The release of Liu Xia, who has never been charged with any crime, is the result of years of campaigning by Western governments and activists and comes just days before the one-year anniversary of the death of dissident Liu Xiaobo while he was serving a prison sentence for inciting subversion.

Liu Xia's brother, Liu Hui, wrote on a social media site: "Sister has already left Beijing for Europe at noon to start her new life. Thanks to everyone who has helped and cared for her these few years. I hope from now on her life is peaceful and happy."

Chinese Premier Li Keqiang is visiting Germany, a country that in May said it would welcome the widow after a recording was released of her crying in desperation and indicating she had lost hope of being able to leave China.

Liu Xiaobo (left) and his wife Liu Xia. AFP / Getty Images file

Liu's close friends Gao Yu, a veteran journalist in Beijing, and Wu Yangwei, better known by his pen name Ye Du, said Liu Xia was on a Finnair flight to Berlin that left Tuesday morning. Wu said he spoke to Liu Xia's older brother, Liu Tong.

"Liu Xia has been kept isolated for so many years," Wu said by phone from the southern city of Guangzhou. "I hope that being in a free country will allow Liu Xia to heal her long-standing traumas and wounds."

Friends say Liu Xia has expressed a preference for going to Germany, where she has a circle of friends from China's dissident and literary circles. German Chancellor Angela Merkel meets regularly with dissidents during visits to China and has raised Liu Xia's case with Chinese officials, including during a visit in May, people familiar with the matter said.

When Liu Xiaobo died, German Foreign Minister Sigmar Gabriel urged the Chinese government to let Liu Xia and her brother leave the country for Germany.

Liu Xia in June 2009. David Gray / Reuters file

China sentenced Liu Xiaobo in December 2009 to 11 years in prison on charges of inciting subversion of state power after he helped write a manifesto calling for political and economic liberalization.

Days after the Nobel Committee awarded him the Peace Prize in 2010, infuriating Beijing, Chinese authorities put Liu Xia under house arrest. State security assigned guards around-the-clock outside Liu's Beijing home and restricted her access to the internet and the outside world, allowing her only occasional phone calls with a small circle of friends.

A Chinese foreign ministry spokeswoman, Hua Chunying, confirmed Tuesday that Liu had left for Germany, saying she was seeking "medical treatment on her own accord."