Facebook said the request was “by far the largest” it had ever received from a government body.
Photographs, private messages and other information were supplied to a New York court last year, but the process was only made public by a judge this week.
The ruling defined Facebook as a “digital landlord”.
A judge said this definition meant the company must comply with search warrants.
The original case investigated fraudulent claimants of US federal disability benefits, whose Facebook accounts apparently showed that they were in fact healthy.
The social media site was ordered to hand over information from the 381 accounts, which the court said contained “evidence of criminality”.
After an appeal was denied, Facebook complied with the request but protested that it violated the Fourth Amendment of the US constitution, which protects against “unreasonable searches and seizures”.
Facebook also voiced concerns about the lack of date restrictions on the warrant, which it argued allowed the US government to keep the data indefinitely, and the range of data requested, which it said would contain private material which bore no relation to the trial.
The proceedings have been kept private by the court, but after a fresh appeal by Facebook a New York judge has now made the court filing public.
Facebook said the government had obtained “gag orders”, preventing it from telling the account holders that it had been forced to hand over their data.
“This unprecedented request is by far the largest we’ve ever received – by a magnitude of more than ten – and we have argued that it was unconstitutional from the start,” wrote Chris Sonderby, a legal adviser to Facebook.
“Of the 381 people whose accounts were the subject of these warrants, 62 were later charged in a disability fraud case.
“This means that no charges will be brought against more than 300 people whose data was sought by the government without prior notice to the people affected.”
But a spokesperson for the Manhattan district attorney defended the court’s actions.
“This was a massive scheme involving as many as 1,000 people who defrauded the federal government,” said Joan Vollero.
“The defendants in this case repeatedly lied to the government about their mental, physical, and social capabilities. Their Facebook accounts told a different story.”
In a summation of the legal justification for the court’s decision, the judge wrote: “Facebook could best be described as a digital landlord, a virtual custodian or storage facility for millions of tenant users and their information.
“Hence, the search warrants authorize the search and seizure of digital information contained within the Facebook server.”
JtyUmfP6O8EAt least 158 people have died in Spain's worst flooding disaster in generations. On October…
Google has been fined two undecillion (a two followed by 36 zeroes) roubles by a…
Embarking on a home remodel is an exciting journey, promising enhanced comfort, increased property value,…
The US presidential candidates continued to campaign across key swing states on October 20. Footage…
Elon Musk has said he will give away $1 million a day to a registered…
India and Canada have decided to expel their top envoys along with other diplomats as…