BEIJING — A former journalist and his wife have been detained by security officers in China after he wrote online last week about five boys in Guizhou Province who died in a trash bin after taking shelter there from the cold, according to a lawyer and a friend of the ex-journalist.

The lawyer, Li Fangping, said in a telephone interview that the ex-journalist, Li Yuanlong, who is not related to the lawyer, was picked up by security officers on Wednesday. The men spoke by telephone while Mr. Li was being driven along a highway to a “resort” in Guizhou in south-central China, the lawyer said Thursday. A friend of Mr. Li’s who edits an online publication said Mr. Li’s wife had been taken too.

Mr. Li, 52, had been a reporter for Bijie Daily, the main newspaper in the city of Bijie, for eight years, but was imprisoned in 2005 for two years because he had written too many “negative” stories about Bijie, the lawyer said. He has been unemployed since his release from prison, the lawyer added.

Late last week, Mr. Li posted photographs and wrote about the deaths in Bijie of the five boys, who were all related and ranged in age from 9 to 13. The bodies were discovered on Nov. 16 in a rolling trash bin. The local police said the boys appeared to have died of carbon monoxide poisoning after they started a fire with charcoal inside the bin to warm themselves. At least four of the boys had dropped out of school, according to official news reports.