Updated

Playmate Dani Mathers was ordered to clean up graffiti for secretly snapping a photo of a naked 71-year-old woman in a locker room and posting it online with a mocking comment.

The Playboy centerfold pleaded no contest to misdemeanor invasion of privacy in Los Angeles County Superior Court Wednesday for the case that sparked outrage over the incident of so-called body shaming.

dani mathers in court ap

Model and Playboy bunny Dani Mathers appears in Los Angeles County Superior Court to answer charges related to her taking a photo of a naked, 71-year-old woman in a gym locker room and posting it on social media in Los Angeles on Wednesday, May 24, 2017. (AP)

"Body shaming can devastate its subject," Los Angeles City Attorney Mike Feuer said. "People are mocked, they're humiliated and in ways they can never fully get back."

The 30-year-old had previously apologized for taking the photo at an LA Fitness club in July and posting it on Snapchat with the caption: "If I can't unsee this then you can't either."

The posting was accompanied by a selfie of Mathers in a tank top with her hand over her mouth as if she's gasping in horror.

The 2015 Playmate of the Year said she intended to send the photo privately to a friend and accidentally posted it publicly.

Mathers was relieved to put the case behind her and was grateful to be spared a jail term, defense attorney Thomas Mesereau said outside court.

"She really apologizes from the bottom of her heart for what happened," he said. "She never thought this would come out like this. Never intended to hurt anyone."

Mathers didn't bothered by her sentence posting a selfie on Instagram Wednesday with the caption, "Have a GREAT day" while blowing a kiss to her followers.

Under terms of the plea, Mathers will be on probation for three years and must not take photos of people or post them online without their permission.

She was ordered to either serve 45 days in jail or 30 days of graffiti removal. She chose the latter.

Defense lawyer Dana Cole earlier argued unsuccessfully that the charge should be dismissed because the woman in the photo can't easily be identified.

The victim, who has not been named, had been expected to testify if the case went to trial, according to Rob Wilcox, a spokesman for the Los Angeles city attorney.

Defendants who plead no contest do not admit guilt but do not dispute the charges and are convicted.

The Associated Press contributed to this report.