BEIJING — Chinese security agents in Sichuan Province detained Liao Yiwu, a prominent author and critic of the government, as he prepared to fly Monday to a literary festival in Germany, human rights activists said.

It was the 13th time Mr. Liao had been prevented from leaving the country. The Associated Press reported that he had been placed under house arrest after being questioned by security agents for four hours.

“How can this happen?” The A.P. quoted him as saying. “It’s a cultural event, nothing political. Such drama!”

Telephone calls on Tuesday to Mr. Liao’s home in rural Chengdu produced a recording saying that the line was temporarily unavailable. Calls to his cellphone went unanswered.

Mr. Liao was removed from a plane at Chengdu’s airport as he prepared to fly to Germany to attend lit.Cologne, one of Europe’s largest literary festivals, where he was to read from one of his books, “Miss Hello and the Farm Emperor: Chinese Society From the Bottom.”

“The reason for inviting Mr. Liao was simple: he’s a great writer,” Traudle Berger, a spokeswoman at the Cologne Festival, said in an interview on Tuesday. “And China should be proud of such a great writer.”

Ms. Berger said Mr. Liao’s scheduled reading would still take place, with an actor assuming his role. Proceeds from the ticketed event will be donated to the human rights group Amnesty International, she said.

Last September, Mr. Liao was barred from traveling to Berlin to attend an event affiliated with the Frankfurt Book Fair, at which China was designated the honored guest.

A poet, screenwriter and new-journalism author, Mr. Liao, 51, is one of China’s best known and most outspoken writers. Many of his works tell stories of people who have been left behind in the nation’s rush to economic and political prominence, characters that include prostitutes, a grave robber, and a lavatory attendant.

His 2008 book “The Corpse Walker,” another view of Chinese society’s lower rungs, was published to international acclaim. His works are banned in China, but he has gained a large underground following, and pirated versions of his works can be found in some Chinese bookstores.

Mr. Liao was imprisoned for four years in the early 1990s after writing an epic poem, “Massacre,” which denounced the Chinese government’s suppression of the 1989 Tiananmen Square protests. In December 2007, when he traveled to Beijing to receive an award from the Independent Chinese PEN Center, a writers’ rights organization, he was detained by the police and sent back to Chengdu.

In a text-message exchange last month, Mr. Liao said he had repeatedly met with Chengdu security officials to negotiate for permission to attend the Cologne event, but was told that he had been blacklisted by Beijing officials and forbidden to travel abroad.

In a Monday interview with the German network Deutsche Welle, Mr. Liao said he was seated on the plane at Chengdu’s airport on Monday morning when a flight attendant approached and told him that “someone is looking for you.”

“I asked who it was, and she said it would be best if I got my luggage,” the newspaper quoted him as saying. “I got my bags, and while I was walking to the cabin door, I saw a police officer.”

Mr. Liao said the police told him, “You cannot continue doing whatever you want.”

“I told them there will be many readers at the festival,” he said. “I would like to go and meet them and read some of my own pieces and play the traditional Chinese mouth organ, the xiao. I said it was purely a literature festival and nothing political. They said they understood and were only doing their job following orders from the top.”

On Monday, the PEN American Center, which like the Chinese organization is one of 145 affiliates of the International PEN Center, called on China’s president, Hu Jintao, to lift restrictions on Mr. Liao and other writers.

“It is hard to figure what the Chinese government hopes to accomplish by preventing one of its most compelling literary voices from meeting with international colleagues and readers,” Larry Siems, who directs the American center’s Freedom to Write program, said in a written statement.

Human Rights in China, a group based in Hong Kong, later published an open letter from Mr. Liao to German readers. In it, Mr. Liao recounts learning to play the xiao while in prison, under the tutelage of an old monk.

“How many other sages like my master are there among the Chinese people now?” he wrote. “I do not know. How many innocent political prisoners are still imprisoned? I also do not know. But writers like me from the bottom of society still have to write, record and broadcast, even to the dismay of the Communist Party of China. I have the responsibility to make you understand that the life of the Chinese spirit is longer than the totalitarian government.”

Germany’s Foreign Ministry issued a statement expressing regret at China’s detention of Mr. Liao. China’s Foreign Ministry spokesman, Qin Gang, told journalists on Tuesday that Chinese citizens were free to travel according to Chinese laws.

“We hope the relevant government will respect the law enforcement carried out by the Chinese authorities,” he said.