The court on Wednesday lifted a stay of a ruling by the judge overseeing the San Francisco trial and noted that the judge's findings strongly justify access in this case, the Los Angeles Times reported Friday.
It's the first time such an order has been enforced in a California court, the Times said.
Last year, the California Supreme Court ruled that the defense in the gang case could have social media postings that were public at the time of the killings, but that ruling did not deal with private postings.
The Supreme Court ruling means that the lower court judge could review any postings obtained from Facebook, Instagram and Twitter and decide which ones will be given to the defense.
Facebook has an ongoing appeal against the San Francisco judge's ruling. However, if the ruling is upheld and Facebook refuses to hand over postings, it might be held in contempt of court.
"We believe that federal law prohibits an order requiring us to turn over private Facebook and Instagram account content of crime victims to a defendant and his defense lawyers," Facebook said in a statement. "We will continue to protect our users' privacy interests and are considering options in light of the court's order."
A message seeking comment from Twitter was not immediately returned.
The California Supreme Court's decision is not binding on other courts, but it is expected to be cited by defense attorneys seeking private posts in other cases.
For years, social media companies have opposed efforts by criminal defense attorneys to access accounts, arguing that federal privacy law - the Stored Communications Act - bars cooperation except in limited circumstances.
In the past, only law enforcement has been able to force social media companies to provide private postings.
The criminal case is the prosecution of a killing and attempted killing involving a June 2013 drive-by shooting in San Francisco.
A 14-year-old boy who participated in the shooting told police that beforehand he had interacted with the slain victim, who had "tagged" him on Instagram in a video that included guns.
The boy said he shot that victim six times and asserted that the victim "would have done the same thing to us."
The boy was tried in juvenile court and found to be responsible for the murder of Jaquan Rice Jr. and attempted murder of Rice's girlfriend, who was a minor. The boy was declared a ward of the court, and he was committed for a term of 83 years, four months to life.
Two other defendants, Derrick Hunter and Lee Sullivan, were separately indicted on murder, attempted murder and other charges.
Prosecutors say Hunter, Sullivan and the minor are members of a gang and that Rice was killed because he was part of a rival gang and threatened the boy via social media. They recently invoked their right to a speedy trial, and a jury was selected earlier this month.
Defense attorneys have served subpoenas on Facebook, Instagram and Twitter in an effort to gain access to private, public and deleted postings from the accounts of Rice and a prosecution witness.
Information from: Los Angeles Times, http://www.latimes.com/
Copyright 2019 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.