"In court this morning, we had a complete and total victory," said Chyna's attorney, Lisa Bloom, outside the courthouse. "The judge gave us everything we asked for."
Los Angeles Superior Court Commissioner James E. Blancarte issued the temporary restraining order pending a hearing set for Aug. 8. The restraining order prevents physical contact, but it also prevents Kardashian from posting anything about Chyna online. The judge said his primary concern was Kardashian and Chyna's infant baby.
Last week, Kardashian posted explicit images of Chyna and attacked her in posts on Instagram and Twitter. Chyna's attorney Lisa Bloom has accused Kardashian of cyber bullying.
"As we have said all along, revenge porn is a form of domestic abuse. It is also a crime in California and 38 other states. And it's a civil wrong," Bloom said.
Kardashian did not appear at Monday's hearing. His lawyer, Robert Shapiro, apologized on his client's behalf outside the courthouse.
"I personally, on Mr. Kardashian's behalf, apologized and offered our regrets for what has taken place in the past couple of days," he said. "Now we move forward to do one thing and one thing only: Whatever's in the best interest of this child."
Shapiro said his client will comply with the temporary restraining order, adding that the child, Dream, is with Kardashian.
"I'm just going to get back to co-parenting Dream," Chyna said after the hearing.
The court hearing came after Chyna spoke in an exclusive interview with ABC News, saying she felt "betrayed" by the reality television star.
The Associated Press contributed to this report.