The US government "fatally undermined" Lavabit, the secure email service used by whistleblower Edward Snowden, when it demanded access to encryption keys that kept the service secure, the American Civil Liberties Union said in court filings on Friday.

The ACLU has filed a "friend of the court" briefing in defence of Lavabit and its founder, Ladar Levison, who faces contempt of court charges after his decision to close down his service rather than co-operate with US authorities.

ACLU lawyer Catherine Crump said the government's "unreasonably burdensome" demands "fundamentally destroyed the company as a whole".

"Lavabit's business was predicated on offering a secure email service, and no company could possible tell its clients that it offers a secure service if its keys have been handed over to the government," Crump said.

Lavabit closed its service in August after the US authorities demanded he hand over the encryption keys for its entire service – a move Levison said would have compromised the personal details of his 40,000 clients.

Levison had previously offered the FBI access to the account that is believed to have been used by Snowden. The name of the FBI's target is redacted in court documents, and Levison is gagged by a court order from commenting.

Lavabit gave up the encryption keys after the government obtained court orders – including a grand jury subpoena and a stored communications act –and an authorised search warrant. The court denied Lavabit's motion to quash the warrants, and when the company failed to do so by the stipulated deadline, the court held Lavabit in contempt.

"The district court's contempt holding should be reversed, because the underlying orders requiring Lavabit to disclose its private keys imposed an unreasonable burden on the company. Although innocent third parties have a duty to assist law enforcement agents in their investigations, they also have a right not to be compelled "to render assistance without limitation regardless of the burden involved", ACLU said in its brief.

Crump said encryption services were a fundamental part of the internet. "Encryption has been mischaracterised by some people," she said. "Far from being the domain of criminals, encryption is a valuable tool used by everyone on the internet."

Lavabit was under no legal obligation to design a system that would give the government easy access to its clients' information, the ACLU argues.

"Whereas Congress has required telecommunications carriers, such as telephone companies, to build surveillance capabilities into their networks that enable the government to intercept users' communications and related metadata in real time, it has explicitly refrained from extending this requirement to email service providers," the court documents state.

The government had won court-ordered access to accounts on Lavabit rival Hushmail.

Hushmail's court-ordered co-operation triggered "a barrage of negative publicity after information about its surveillance assistance appeared in court documents", the ACLU argues.

"Whereas the government required Hushmail to provide only particular users' data, Lavabit faced a demand for the private encryption keys protecting all of its users' data, and would likely have fared much worse."

Lavabit is currently fighting its contempt charges and has filed briefs arguing that the US investigation violated its constitutional fourth amendment right to protection from unreasonable searches. The company has set up a legal fund to help with the costs that has so far raised $96,000.