Singer CeeLo Green was sentenced to three years of formal probation and 360 hours of community service after he pled no contest on Friday to slipping a woman ecstasy at a restaurant in Los Angeles.

CeeLo will also have to attend 52 classes for Alcoholics or Narcotics Anonymous and pay restitution to the victim.

Green, whose legal name is Thomas DeCarlo Callaway, was standing trial for one felony count of furnishing a controlled substance. His plea was entered just before a scheduled preliminary hearing was set to begin. A no contest plea allowed Green to maintain his innocence while still agreeing to the punishments.

"I'm very pleased to have fully resolved this matter with an amicable understanding. We're satisfied," CeeLo said on leaving the courthouse.

The 39-year-old allegedly slipped ecstasy to woman while having dinner together in July 2012. After the meal, the pair went back to the 33-year-old woman's hotel room. The woman initially thought CeeLo had spiked her drink because the "next thing" she remembered was waking up in her hotel room naked.

Prosecutors had insufficient evidence to file rape of an intoxicated person charges, and CeeLo's attorney said any sexual contact between his client and the woman was consensual.

CeeLo's mandatory community service will be provided with the MusicCares Foundation. The judge, Mark Young, also said he would allow CeeLo to travel for work-related matters while on probation. He will still be required to check in with a probation officer and periodically with the court. The first of these progress report appearances is set for March 2, 2015.

While he is most recently known for his judging appearance on the NBC singing competition, "The Voice," CeeLo is well-known for songs like "Forget You" and "Crazy" with his band Gnarls Barkley. He initially rose to fame as part of the hip-hop group Goodie Mob.