The US government threatened to fine Yahoo $250,000 a day if it refused to hand over user data to the National Security Agency, according to court documents unsealed on Thursday.

In a blogpost, the company said the 1,500 pages of once-secret documents shine further light on Yahoo’s previously disclosed clash with the NSA over access to its users’ data. The size of the daily fine was set to double every week that Yahoo refused to comply, the documents show.

The papers outline Yahoo’s secret and ultimately unsuccessful legal battle to resist the government’s demands for the tech firm to cooperate with the NSA’s controversial Prism surveillance programme, revealed by whistleblower Edward Snowden last year.

“The released documents underscore how we had to fight every step of the way to challenge the US government’s surveillance efforts,” said the company’s general counsel, Ron Bell, in a Tumblr post.

The US government amended a key law to demand user information from online services in 2007. When Yahoo was asked to hand over user data the company objected arguing the request was “unconstitutional and overbroad”.

Yahoo took its case to the foreign intelligence surveillance court, also known as the Fisa court, which oversees requests for surveillance orders in national security investigations. The secretive Fisa court provides the legal authorities that underpin the US government’s controversial surveillance programmes. Yahoo lost its case, and an appeal.

The government argued that Yahoo’s terms of service agreement diminished its users’ expectations of their right to privacy. Yahoo countered that the terms said the company would share information when “required to do so by law” and did not support the government’s assertion that it should hand over information “on request”.

The company also warned that the searches were likely to take in communications by US citizens, which the NSA was expressly not supposed to be collecting.

“Yahoo! receives [redacted] orders to gather communications, [redacted] for users whom the government may not be able to identify beyond their email addresses. The possibility that those requests target some US persons is significant,” the company said in court filings made in 2008.

“Unless the court prohibits the targeting of US persons communications now, the government can search accounts of US persons under the existing directives later without facing a future challenge by Yahoo,” the company said.

The government argued that there were “reasonable procedures” in place to determine that it was only collecting information about people not in the US. Government lawyers argued that the requests did not violate the fourth amendment right against unreasonable searches because the amendment does not require it to obtain a warrant to acquire foreign intelligence.

Snowden’s revelations showed that the NSA was in fact collecting information from US citizens on a massive scale without a warrant using a secret rule change allowing NSA analysts to search for Americans’ details within the databases.

Federal judge William Bryson, presiding judge of the foreign intelligence surveillance court of review, which reviews denials of applications for electronic surveillance warrants, unsealed the documents on Thursday.

Disclosures in the Guardian and the Washington Post about the Prism programme, which was discontinued in 2011, prompted an international backlash over allegations of overreach in government surveillance and against the tech companies which cooperated with it.

“Despite the declassification and release, portions of the documents remain sealed and classified to this day, unknown even to our team. The released documents underscore how we had to fight every step of the way to challenge the US government’s surveillance efforts. At one point, the US government threatened the imposition of $250,000 in fines per day if we refused to comply,” wrote Bell.

“Our fight continues. We are still pushing for the FISC [Fisa court] to release materials from the 2007-2008 case in the lower court. The FISC indicated previously that it was waiting on the FISC-R ruling in relation to the 2008 appeal before moving forward. Now that the FISC-R [court of review] matter is resolved, we will work hard to make the materials from the FISC case public, as well.”

Almost all the major US tech firms including AOL, Apple, Google and Microsoft were listed by the NSA as participants in the programme, which was run in conjunction with the NSA’s British equivalent, GCHQ.

Begun under the Bush administration the programme collected information from the major tech companies under Section 702 of the Fisa Amendments Act. The NSA’s slides obtained by Snowden contained a briefing presentation which said Prism granted access to records such as emails, chat conversations, voice calls, documents and more.

Patrick Toomey, a staff attorney with the American Civil Liberties Union’s national security project, said he had not yet reviewed all the documents but that it appeared Yahoo “had challenged the warrantless wiretapping programme more than any other of its competitors”.