Daniel McGowan was returning to his cell in the Sandstone, Minn., federal prison when he learned he was shipping out. At first he didn't know where, or why, which is standard procedure for the U.S. Bureau of Prisons.

His destination that day in 2008 was a special unit in the Marion, Ill., federal prison for inmates whose words were considered so dangerous that every phone call, letter and visit required tighter controls than the supervision offered in low-security Sandstone.

A week later, the bureau gave him an explanation that restated his crimes, the environmentally motivated arson of two lumber facilities in Oregon. The true reasons emerged more than three years later, after McGowan sued the government: While behind bars, he had written articles for websites that prison officials considered subversive.

McGowan completed his sentence in 2013, but his legal journey through the federal corrections system continues. Last month, he lost the latest round. A federal appeals court in New York ruled that prison officials did not violate McGowan's First Amendment rights when they put him in solitary confinement for publishing an article in the Huffington Post.

McGowan's case shows the uneasy balance between prisons' security needs and the right to free speech, which is limited for prisoners but not eliminated. Twice, the Bureau of Prisons punished McGowan for his writing, and judges have so far exonerated the agency of any wrongdoing.

McGowan was affiliated with the Earth Liberation Front, a radical environmental group, when it burned two businesses in 2001. He renounced his membership in the group and moved to the other side of the country, but he could not escape his past and was arrested at his job in 2005.

McGowan pleaded guilty to arson and conspiracy and was sentenced to seven years. He was considered a small enough security risk to serve his sentence at Sandstone, about 90 miles north of the Twin Cities. When his wife visited, he could spend time with her in person. He could make long telephone calls and send and receive mail with few restrictions.

McGowan's writings in the Earth First! Journal, Portland Independent Media and other websites caught the eye of the Bureau of Prisons. In them, he complains about "snitches" and argues for "direct action."

Those statements seemed provocative enough to prison officials that they transferred McGowan to the facility in Marion, home to one of two Communications Management Units (CMUs). These Orwellian-sounding places were set up during President George W. Bush's administration in 2006 and 2008 as a way to keep close tabs on terrorists and others who might continue to orchestrate crime through phone calls, letters and visits with outsiders.

McGowan described it this way, in a Huffington Post article in 2013: "When my wife and loved ones visited me at the CMUs, we were banned from any physical contact whatsoever. All interactions were conducted over a telephone, with Plexiglas and bars between us."

"I wouldn't say anyone would ever silence Daniel," said one of his attorneys, Rachel Meeropol, of the Center for Constitutional Rights in New York. "It certainly limited his ability to engage on lawful, political issues inside prison."

McGowan spent more than two years in the CMU, briefly rejoining the general population, before his transfer to the other CMU, in Terre Haute, Ind., in February 2011. In December 2012, he was transferred to a halfway house in Brooklyn, N.Y., to finish the final months of his sentence.

On April 1, 2013, he published an account of his ordeal in the Huffington Post, describing how it took years for him to learn that it was his writings that prompted his abrupt transfer out of Sandstone.

Once again, the Bureau of Prisons took notice. On April 4, 2013, McGowan was hauled into solitary confinement and accused of violating a law against prisoners working as reporters. The problem was, that law had been declared unconstitutional six years earlier.

McGowan's lawyers got him out 22 hours later. But his resulting lawsuit was tossed out last month by the Second Circuit Court of Appeals, which ruled that an inmate writing articles was not a "clearly established right" at the time.

Everything's being appealed. Maybe by the time it's over, the Bureau of Prisons will be able to tell the difference between truly dangerous talk and writing it just doesn't like.

Contact James Eli Shiffer at james.shiffer@startribune.com or 612-673-4116.