Judge Scott Gordon issued a restraining order against Oksana's confidante, Kristian Otto Herzog, after Mel Gibson's lawyers claimed he's a danger to Mel's daughter.
As we first reported ... Herzog is a twice-convicted felon -- each case involving firearms. He was released from jail in March after serving 255 days. He is currently on probation.
We're told Mel had asked Oksana to keep Herzog away from Lucia ... but she refused. So today Mel's lawyers asked the judge for a restraining order ... which has been granted.