The US government threatened to fine Yahoo $250,000 (£154,000) a day if it failed to turn over customer data to intelligence agencies - a step the search engine company regarded as unconstitutional.
The details emerged after a federal judge ordered the unsealing of some court documents about a legal challenge launched by Yahoo in 2007 against government surveillance.
Yahoo lost the court battle, which experts say helped pave the way for the Prism surveillance programme revealed last year by former National Security Agency contractor Edward Snowden.
Marc Rotenberg, executive director of the Electronic Privacy Information Centre, said: "It's always been a little bit behind the curtain as to what internet companies do when they actually receive these requests.
"Now we have evidence that Yahoo did in fact fight this battle and look at considerable fines as a consequence of not disclosing the data.
"It tells us how very serious the Bush administration was about trying to get the internet firms to turn over this data. Until the disclosure, it was mostly hearsay that they were willing to impose these penalties."
US internet companies are eager to disclose as much as they can about the procedure through which federal agencies request their user data in secret courts, in part because of worries about the impact on their business.
On Thursday, Yahoo said it would begin to make public some 1,500 previously classified pages documenting the lengthy tussle with the US government.
"Despite the declassification and release, portions of the documents remain sealed and classified to this day, unknown even to our team," Yahoo general counsel Ron Bell said in a blog post on the company's website.
Earlier this year, Yahoo, Facebook, Microsoft and Google began publishing details about the number of secret government requests for data they receive, hoping to show their limited involvement in US surveillance efforts.