Edward Snowden is not entitled to the profits from his memoir Permanent Record, and any money made must go to the US government, a judge has ruled.

Permanent Record, in which Snowden recounts how he came to the decision to leak the top secret documents revealing government plans for mass surveillance, was published in September. Shortly afterwards, the US government filed a civil lawsuit contending that publication was “in violation of the non-disclosure agreements he signed with both the CIA and the National Security Agency (NSA)”, and that the release of the book without pre-publication review by the agencies was “in violation of his express obligations”. Snowden’s lawyers had argued that if the author had believed that the government would review his book in good faith, he would have submitted it for review.

Earlier this week, district judge Liam O’Grady ruled that the government is entitled to Snowden’s proceeds from the book.

In response, Snowden wrote on Twitter: “The government may steal a dollar, but it cannot erase the idea that earned it … I wrote this book for you, and I hope the government’s ruthless desperation to prevent its publication only inspires you read it – and then gift it to another.”

Asked by one fan if it was possible to buy the book and donate the same amount to Snowden, as “an easy way to stick it to the US government”, Snowden recommended that readers donate money to the families who had helped shelter him in Hong Kong after the story broke in 2013, providing a link to the charity that supports them.

Snowden said the book would continue to be sold. “The court’s ruling is a hack intended to circumvent first amendment limits on what the government can censor,” he told his followers. “They can’t (yet) ban the book, so they ban profit to try and prevent such books from being written in the first place.”

Snowden’s lawyer, Brett Max Kaufman, told the New York Times that it was “far-fetched to believe that the government would have reviewed Mr Snowden’s book or anything else he submitted in good faith”, and “for that reason, Mr Snowden preferred to risk his future royalties than to subject his experiences to improper government censorship”.

“We disagree with the court’s opinion and will review our options,” he added.