A judge has denied Robin Thicke custody of his young son, Julian, while also handing the singer a restraining order refusing him contact with his ex-wife Paula Patton.

Thicke, 39, sought to obtain sole custody of six-year-old Julian but a judge ruled against the Blurred Lines singer, instead granting him monitored visits only. Los Angeles Superior Court judge Colin Leis also handed Thicke a temporary restraining order banning the singer from contacting Patton, 41, and her mother Joyce Patton.

In court documents, Patton allegedly accuses her former spouse of emotional and physical abuse including infidelity throughout their marriage. The Mission:Impossible actress alleges that in April 2013, Thicke shoved her to the ground and kicked her. Thicke is also alleged to have struggled with substance abuse while they were married.

Earlier in January, police were called to Joyce's home after Thicke reportedly refused to leave and demanded to see his son. Detailing the ordeal, Patton said in court papers: "This last incident with Robin was terrifying for me. It was terrifying for our son."

Justifying the restraining order, the judge notes that Thicke has an alleged history of domestic violence and poses a flight risk if allowed access to his son. The Lost Without You singer is not permitted to travel outside Los Angeles County with Julian.

However, Thicke's lawyer Larry Ginsberg has filed court papers in his defence arguing there was no basis for Patton's claims. Instead, Thicke accuses the actress of manipulating their son and admits that while he has spanked Julian, he has never abused the child.

Robin Thicke and Paula Patton
Paula Patton filed for divorce from Robin Thicke in 2014 after nine years of marriage REUTERS/Danny Moloshok

Patton's argument was reportedly supported by Julian's school, who previously asked child welfare services to investigate the abuse allegations. A further hearing on the temporary restraining order is scheduled for 24 February.

Thicke and Patton married in 2005 after 12 years of dating but the actress filed for divorce in 2014. The former couple welcomed their only child, Julian, in April 2010.

In a 2015 deposition regarding a lawsuit over his Blurred Lines single, Thicke admitted to drug use. The Grammy-nominated singer said: "Every day I woke up, I would take a Vicodin to start the day and then I would fill up a water bottle with vodka and drink it before and during my interviews. I don't recall many things that I said. In fact, I was quite surprised when I read them back sometimes."

Christmas Day with my precious angel #fbf

A photo posted by Paula Patton (@paulapattonofficial) on