Facebook was ordered by a U.S. judge on Wednesday to release records of accounts connected to anti-Rohingya violence in Myanmar.
The ruling, by a magistrate judge in Washington, criticised Facebook for failing to hand over information to investigators seeking to prosecute the country for international crimes against the Muslim minority group.
Facebook has previously refused to release the data, saying it would violate a U.S. law barring it from disclosing users' communications.
But the judge said the posts, which were deleted, would not be covered under the law.
He said: "Facebook taking up the mantle of privacy rights is rich with irony. News sites have entire sections dedicated to Facebook's sordid history of privacy scandals."
A spokesperson for Facebook said the company was reviewing the decision and that it had already made "voluntary, lawful disclosures" to another U.N. body.
The social media giant has been accused of playing a key role in the spread of hate speech that fueled violence against the Muslim minority group in 2017.
That year, more than 730,000 Rohingya Muslims fled Myanmar's Rakhine state after a military crackdown that refugees said included mass killings and rape.
A Reuters investigation in 2018 found more than 1,000 examples of hate speech on Facebook,
including calling Rohingya and other Muslims dogs, maggots and rapists, suggesting they be fed to pigs, and urging they be shot or exterminated.
Gambia wants Facebook's data as it's pursuing a case against Myanmar at the International Court of Justice (ICJ) in the Hague.
It accuses Myanmar of violating the 1948 U.N. Convention on Genocide.
Those claims have been denied by Myanmar's authorities who say they were battling an insurgency.