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.”
JtyUmfP6O8EImage source: Wikimedia Commons President-elect Donald Trump celebrated his election victory at the Ultimate Fighting…
Millions of voters across the US chose to return Donald Trump to the White House…
Donald Trump declares victory in the US election as he addresses jubilant supporters in Florida.…
Stocks around the world are rising as Donald Trump appears to be on the cusp…
Donald Trump has won Pennsylvania, North Carolina and Georgia and taken a lead over Kamala…
Quincy Jones, the celebrated musician and producer who worked with Michael Jackson, Frank Sinatra, Ray…