NEW YORK (AP) — Rapper Kid Cudi has pleaded guilty in New York City to misdemeanor possession of a controlled substance.

The Manhattan district attorney’s office said Tuesday that the charge will be dismissed if the entertainer stays out of trouble for six months and serves two days of community service.

READ MORE: 1 NYPD Officer, Suspect Killed In Harlem Shooting

Cudi was arrested June 11. Police said at the time they believed he had cocaine in his pocket. He performed the next day at the Bonnaroo Music & Arts Festival in Tennessee.

READ MORE: With Tragic Shooting Of 2 Police Officers In Harlem, 5 NYPD Officers Have Been Shot In January

The Cleveland native released his debut album, “Man on the Moon: The End of Day,” in 2009.

Cudi pleaded guilty last Friday through his lawyer. His next court date is March 23.

MORE NEWS: Paterson Community In Mourning After 18-Year-Old Honor Student Robert Cuadra Killed By Stray Bullet

(Copyright 2010 by The Associated Press. All Rights Reserved.)