A lawsuit was filed Monday on behalf of Michael Cohen claiming the former attorney for President Donald Trump was returned to prison because of his plans to publish a book about the president.

The American Civil Liberties Union and law firm Perry Guha LLP filed the suit on behalf of Cohen, who was returned to prison July 9, seven days after he tweeted that he was finishing a book about Trump. At the time, the Bureau of Prisons said Cohen had violated the terms of his home confinement.

The suit alleges: “;On July 9, 2020, U.S. Probation Officers, working on behalf of the BOP, presented Mr. Cohen with an unconstitutional demand: As a condition of his release –; a release BOP already had determined was necessary to protect Mr. Cohen”;s health –; he had to agree to a complete bar on speaking to or through any media of any sort, including via a book.”;

The lawsuit was filed in the District Court for the Southern District of New York. It seeks his immediate return to home confinement. Cohen had been let out of prison in May to serve his sentence at home due to the coronavirus pandemic.

Cohen”;s tweeted July 2 that he anticipated that his book would be released in “;late September,”; less than two months before the presidential election.

“;The First Amendment forbids Respondents from imprisoning Mr. Cohen in retaliation for drafting a book about the President and for seeking to publish that book soon,”; the lawsuit argues.

Two recent books about the president and his life have drawn legal challenges: John Bolton”;s “;The Room Where It Happened”; was challenged on grounds of national security and Mary Trump”;s “;Too Much and Never Enough”; on grounds that it violated a long-standing Trump family nondisclosure agreement. Cohen tweeted approvingly July 2 about a court ruling in favor of Mary Trump”;s book.

Both books were published and became immediate best-sellers.

Cohen, who is serving a three-year sentence, is now in the Federal Correctional Institution in Otisville, N.Y. He pleaded guilty to tax evasion, campaign finance fraud and lying to Congress.

A spokeswoman for the Department of Justice declined comment on the lawsuit. The Bureau of Prisons did not immediately respond to a request for comment following the late-night filing.

Josh Gerstein contributed to this article.

Read more: politico.com