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: Dr. Howard Zucker Steps Down As New York State Health Commissioner

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: Judge Lifts Temporary Pause On Vaccine Mandate For NYC Teachers, Who Now Must Be Vaccinated By Monday

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: NYPD: Search Continues For Man Seen On Video Slashing Bronx Restaurant Worker

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