The Court of Appeal banned the media from carrying reports of a murder trial on their Facebook pages.
Editors were warned that they could face prosecution under the Contempt of Court Act 1981 if they do not comply.
The ruling, which was made in February but can only now be reported, is believed to be the first time a court has specifically restricted social media to avoid comments prejudicing a trial.
The court issued the ban on coverage of a trial of two girls charged with the murder of Angela Wrightson, 39, who was battered to death in her home in Hartlepool.
The girls, were 13 and 14 at the time of the attack at her Hartlepool home in December 2014.
The appeal judges made the order against a group of nine media organisations.
The organisations were told they must:
- Not publish a report of the trial on their Facebook profile, or Facebook pages.
- Disable their website message boards.
An original trial of two girls for the murder of Ms Wrightson was halted at Teeside Crown Court in July last year following a wave of comment and abuse on social media. See the report
The girls cannot be named for legal reasons.
Some media remove archived content, or message boards from reports of crime and court cases, either voluntarily, or following a request from the Attorney General, police or lawyers involved in a case.
But I believe this is the first time the Court of Appeal has issued a specific ban.
Cleland Thom is a consultant and trainer in media law
Email pged@pressgazette.co.uk to point out mistakes, provide story tips or send in a letter for publication on our "Letters Page" blog