NEW YORK (CBSNewYork/AP) – A federal judge ruled Thursday Michael Cohen, President Trump’s former attorney, can be released from prison, again.

The judge agreed with arguments that the government sent Cohen back to prison as payback for a book he was writing about the president.

READ MORE: Road To Reopening: New York Sports And Entertainment Venues Welcome Back Fans At Full Capacity

Michael Cohen (credit: Mark Wilson/Getty Images)

U.S. District Judge Alvin K. Hellerstein said Cohen’s First Amendment rights were violated when he was ordered back to prison on July 9th after probation authorities said he refused to sign a form banning him from publishing the book or communicating publicly in other manners.

“I’ve never seen such a clause in 21 years of being a judge and sentencing people and looking at terms of supervised release,” the judge said during a telephone conference. “Why would the Bureau of Prisons ask for something like this … unless there was a retaliatory purpose?”

Prosecutors declined through a spokesperson to comment on Hellerstein’s ruling.

READ MORE: Lacey Township Residents Eager To Catch Another Glimpse Of Wandering Peacock

In 2018, Cohen was sentenced to three years in jail after pleading guilty to campaign finance charges and lying to Congress, among other crimes.

Cohen served one year and was released in May to complete his sentence at home.

He has been in isolation at an Otisville N.Y. prison camp, quarantined while prison authorities ensure he does not have coronavirus.

Cohen will be release to home confinement Friday afternoon, after taking a COVID-19 test.

MORE NEWS: NYPD Searching For Suspects After Eric Adams Campaign Volunteer Stabbed In The Bronx

(© Copyright 2020 CBS Broadcasting Inc. All Rights Reserved. The Associated Press contributed to this report.)