Edward Snowden, who once worked for the CIA in addition to the NSA, has been living in Russia (File)

Edward Snowden, the former National Security Agency contractor who fled to Russia after leaking information about the US government's mass surveillance program, is publishing a memoir.

The book, "Permanent Record," will go on sale on September 17. It is being published globally by Macmillan Publishers.

Snowden, who once worked for the CIA in addition to the NSA, has been living in Russia since leaking thousands of classified documents to the press in 2013 which revealed the scope of US government surveillance after 9/11.

Praised as a whistleblower and a privacy advocate by his defenders, the United States accuses Snowden of endangering national security.

He is facing espionage charges in the United States that could send him to prison for decades.

"Edward Snowden decided at the age of 29 to give up his entire future for the good of his country," John Sargent, the CEO of Macmillan Publishers USA, said in a statement.

"He displayed enormous courage in doing so, and like him or not, his is an incredible American story," Sargent said. "There is no doubt that the world is a better and more private place for his actions."

On his Twitter account, Snowden said "I wrote a book" and included a link to a video of himself.

"Everything that we do now lasts forever, not because we want to remember but because we're no longer allowed to forget," he says in the video. "Helping to create that system is my greatest regret."