LOS ANGELES -- An actress who accused Los Angeles police of racial profiling when they investigated a report she was having sex with her boyfriend in a parked car has been ordered to apologize to officers as part of a plea deal.

Daniele Watts, who appeared in "Django Unchained," pleaded no contest Monday to disturbing the peace with loudness.

Los Angeles city attorney's spokesman Frank Mateljan says Watts and her boyfriend, who entered the same plea, were sentenced to 40 hours of community and must write apology letters to three officers and the occupants of a building near where they were briefly detained last year.

Lewd conduct charges against the pair have been dropped.

Lou Shapiro, an attorney for Watts and her boyfriend, says the actress will apologize for her comments to police.