Diplos former lover has been ordered to remove explicit photos of the superstar DJ from social media and stay away from him and his family.

The Major Lazer star filed legal papers in a Los Angeles court on Tuesday, accusing the woman, whose identity has not been released, of harassing Diplo and his loved ones after their relationship soured earlier this year.

He claims she shared X-rated pictures and videos of the pair having sex online, and even sent the footage to his exes, including model Jevon King, the mother of his baby son Pace.

Now a judge has ruled in his favour, demanding the woman "identify and remove any such images previously posted or distributed" on social media, and keep a distance of at least 100 yards (91.44 metres) from Diplo, King, and his friend Celene Kabigting, reports TMZ.

The news emerges weeks after Diplo himself was slapped with a protective order from the female in question, who accused him of recording them getting intimate and then distributing it as revenge porn - allegations he has firmly denied.