The U.S. government in 2007 threatened to fine Yahoo $250,000 a day if the company refused to turn over user data to a National Security Agency surveillance program, according to recently unsealed court documents obtained by The Washington Post.

The 1,500 pages of documents show how Yahoo fought to withhold the data, in an unsuccessful legal battle against the government in the secret Foreign Intelligence Surveillance Court and the Foreign Intelligence Court of Review. The NSA had requested the data for its controversial online communications surveillance program known as PRISM. Yahoo's loss of the case required the company to become one of the first to begin providing user data to PRISM.

“We refused to comply with what we viewed as unconstitutional and overbroad surveillance and challenged the U.S. government’s authority,” Yahoo’s General Counsel Ron Bell said in a Tumblr post Thursday afternoon. “Our challenge, and a later appeal in the case, did not succeed.”

PRISM, a program first detailed by the revelations of security contractor Edward Snowden last year, was a wide-ranging effort to access and monitor the online communications of millions of customers who used Yahoo, among other U.S.-based technology firms such as Google, Apple and Facebook. The NSA’s request to Yahoo in 2007 was for metadata — information about whom users were exchanging messages with and when, as opposed to the content of the messages themselves. The program targeted users who were outside the U.S., according to the Post.

The Foreign Intelligence Surveillance Court (FISC) ruled in the government’s favor, but has now unsealed the documents at the request of Yahoo as part of an effort aimed at increasing transparency around the now-discontinued PRISM program.

Yahoo had opposed the government's request "primarily on the ground that the directive violated the Fourth Amendment rights' of its customers," according to a statement by the Office of the Director of National Intelligence and the Justice Department. The Fourth Amendment shields people from unreasonable searches and seizures by the government. The argument failed when "the FISC held that there is a foreign intelligence exception to the warrant requirement." The court also held that there are sufficient procedures in place to protect the Fourth Amendment rights of targeted U.S. persons.

Bell wrote in the post that Yahoo was pushing to make more of the court documents about the case publicly available.

“Users come first at Yahoo,” he said. “We treat public safety with the utmost seriousness, but we are also committed to protecting users’ data. We will continue to contest requests and laws that we consider unlawful, unclear, or overbroad.”