Michael Cohen‘s lawyers filed a lawsuit on his behalf seeking his release from prison in connection to his plans to publish a tell-all book about the president.

The American Civil Liberties Union and law firm Perry Guha filed the suit on behalf of Cohen, former personal attorney for President Donald Trump, against Attorney General William Barr. Cohen’s attorneys alleged that the Justice Department put him back in prison from home confinement in retaliation for writing a book about the president. The lawsuit argues Barr violated Cohen’s First Amendment right to free speech.

Cohen had been allowed to leave prison in May and serve his sentence at home due to the coronavirus pandemic. He was taken back to prison after he began tweeting about the book.

The lawsuit reads: “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 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.

Sue Allison, a spokeswoman for the Bureau of Prisons, told CNN Thursday that Cohen “refused the conditions of his home confinement and as a result, has been returned to a BOP facility.”

Cohen is serving a three-year prison sentence since 2018 when he pled guilty to tax fraud, campaign finance fraud and lying to Congress in connection.