BEIJING — After being denied an exit visa 17 times, yanked off planes and trains by the police and threatened with yet more prison time, one of China’s most persecuted writers, Liao Yiwu, slipped across the border into Vietnam last week and then made his way, via Poland, to Germany, where he promptly declared himself an exile.

Liao Yiwu, one of the most persecuted writers in China, fled into self exile in Germany this week. While still in China, his writings on the plight of the country’s downtrodden had earned him travel restrictions and threats from the police.

“I’m ecstatic, I’m finally free,” he said in a telephone interview from Berlin on Monday morning before plunging into a day of interviews and photo shoots. “I feel like I’m walking through a dream.”

Of course, his escape — arranged by friends whom he declined to name — has not brought unadulterated joy. By fleeing his homeland, Mr. Liao, 52, made the difficult decision to abandon the wellspring of his work, much of it journalistic explorations of China’s downtrodden: the political outcasts, impoverished farmers, death row inmates and others who have been traumatized by famine and Communist-inspired zealotry, then cast aside during the nation’s manic embrace of material wealth and collective amnesia.

He also leaves behind his family in southwestern Sichuan Province, including his mother, his son, two siblings and a girlfriend. “I’m trying to convince myself that I won’t be away from China very long, that things will change sooner than later,” he said.

In the West, Mr. Liao is best known for “The Corpse Walker: Real-Life Stories, China from the Bottom Up,” which was banned in China soon after it was published in Taiwan in 2001. The book, a collection of interviews with people he encountered in prison and during wanderings in the southwest, tells the unadorned stories of 27 people, among them a public toilet attendant, a persecuted landlord, and the men, known as corpse walkers, whose job it is to transport the dead back to their hometowns for burial.

After it was published, his already strained relationship with the authorities worsened. He was barred from traveling to literary festivals in Germany, Australia and the United States, and was forced last spring to sign a vow to cease publishing outside China. Breaking the pledge, he was warned cryptically, would bring even greater torment.

Given the predicament of his friend Liu Xiaobo, the Nobel Peace Prize winner and writer who is serving an 11-year sentence for subversion, Mr. Liao knew what might await him. The threat gained greater urgency with the impending publication in the United States of “God Is Red,” a book by Mr. Liao about Chinese Christians, and a memoir about his time in jail, “The Witness of the 4th of June.” The memoir, whose title refers to the military suppression of the Tiananmen Square protests in 1989, has been delayed several times by skittish publishers in Germany and Taiwan.

His most recent travails are part of a wholesale stifling of creative expression and dissent by the ruling Communist Party. Rattled by turmoil in the Arab world, the government began cracking down on scores of activists and rights lawyers in February. The most prominent victim has been Ai Weiwei, the caustic artist and social critic.

“I think Liao Yiwu’s decision to leave really reflects the extreme unease that writers in China are facing right now,” said Larry Siems, the director of international programs at the PEN American Center, an advocacy group. “It’s a shame, because he is one of China’s most interesting writers, and he has his eyes on some of the great human dramas that accompany China’s emergence as an economic power. China should be unleashing the imagination of its writers instead of trying to restrain and control them.”

The Chinese government has yet to respond to news of his escape. The public security bureau in his hometown would not discuss his case; calls and e-mails to the Chinese Embassy in Berlin were not returned.

Like many of his generation, Mr. Liao has endured a numbing cascade of hardships. He nearly starved to death as an infant during Mao’s disastrous Great Leap Forward, when famine killed more than 20 million people. When he was a child, he and his classmates were forced out of school by the Cultural Revolution, the decade in which education was maligned as a bourgeois indulgence. Much of what he learned came from his father, a teacher of Chinese literature, and his mother, a music instructor.

“As a boy, my dad would make me stand high up on a table and not allow me to come down until I finished reciting the classics,” he said.

As early as 1987, he drew the ire of cultural bureaucrats for poetry, printed in official journals, that was condemned as too pessimistic and anti-establishment. After the Tiananmen crackdown, he experienced the stinging limits on free expression. Inspired by Allen Ginsberg and by Dante’s “Inferno,” he and five friends circulated poems recited on video that lamented the bloodshed in Beijing. Mr. Liao called the piece “Massacre.”

Not long afterward, in 1990, he and the others were jailed as “counterrevolutionaries.” His four years of confinement were characterized by torture and the terror of watching 20 inmates be dragged out for execution. Twice, he said, he tried to kill himself.

But it was in jail that Mr. Liao met many of the characters who would fill “The Corpse Walker.” It was also where he learned to play the xiao, an ancient flutelike instrument that sustained him as a street musician during long bouts of joblessness after his release. Those were bitter years, he said, when friends and even his wife found him politically radioactive.

“I never imagined they would distance themselves from me as if I were the plague,” he said. “From this, I concluded that people’s memories can be easily erased.”

Since then, Mr. Liao has devoted himself to collecting the memories of people on the margins of society. For “God Is Red,” he sought out Christians in rural Sichuan and Yunnan Provinces who had endured years of official persecution.

Mickey Maudlin, the executive editor of HarperOne, described it as refreshingly devoid of polemics. “Liao isn’t trying to score ideological points,” Mr. Maudlin said by phone from San Francisco. “He’s just trying to describe how people survived in an environment that is not very friendly.”

Mr. Liao said that since he reached Germany, he has been too overwhelmed and excited to eat or sleep much. Having arrived with no money, he is relying on the generosity of friends, his German publisher and, he hopes, royalties from his forthcoming books. He speaks neither German nor English, and said he was unsure whether to plunge into learning a new language.

“Germany, the U.S. and Australia have all welcomed me,” he said. “But the place I really want to be is China.”