Media playback is unsupported on your device Media caption "I was devastated... this is a person I trust in, I confide in."

Former model and social media star Blac Chyna has been granted a restraining order by a California judge against her former fiance Rob Kardashian.

The domestic violence order comes after Mr Kardashian published explicit images of the 29-year-old online.

Mr Kardashian's lawyer said on Monday his client "regrets" his actions.

Speaking to reporters outside the Los Angeles courthouse, Ms Chyna thanked the judge "for granting me this restraining order to protect me".

Blac Chyna 'devastated' by explicit shots posted online by Rob Kardashian

The couple announced their engagement last April on their reality television programme, but separated in December.

Image copyright Getty Images Image caption Ms Chyna thanked the judge for granted the order

"I'm just going to get back to co-parenting Dream", Ms Chyna told reporters after the decision, referring to their infant daughter who was born in November.

Robert Shapiro, who was in court to represent Mr Kardashian, did not contest the temporary court order, saying after the verdict: "Now we move forward to do one thing and one thing only - whatever is in the best interest of the child."

Mr Kardashian was not in the court for Monday's hearing.

The order comes after Mr Kardashian, 30, posted explicit images on Instagram to his nine million followers last week.

Image copyright Getty Images Image caption The couple appeared together in May 2016 at a birthday party for Chyna

He also accused the mother of his child of taking drugs and having plastic surgery.

Instagram removed his account, and he began posting on Twitter before that website, too, removed the offensive posts.

"I was devastated, of course," Ms Chyna told ABC News earlier on Monday. "I'm like, 'How could somebody post these pictures of me?'"

Revenge porn is a criminal offence in California.

Image copyright Getty Images Image caption The birthday party also served as the launch for her brand of emojis

In the US state, it is illegal to intentionally distribute "the image of the intimate body part or parts of another identifiable person".

Lisa Bloom, a lawyer representing Ms Chyna, said she was grateful to be working with her to address this "important women's rights issue".

Ms Chyna also accused Mr Kardashian in a Snapchat post of physically assaulting her in April.

That post was later deleted.

The judge will reexamine the restraining order at the couple's next hearing in August. They maintain joint custody of their child until then.