As part of the plea deal, Bruno Mars will be allowed to pay a $2,000 fine, perform 200 hours of community service and serve probation. He also has to do drug counseling.
If he stays clean for a year, the conviction will be wiped away. His attorney says Mars "is very appreciative" to catch a break on his case and is taking the matter "quite seriously."
The singer was arrested in September of last year after performing at a nightclub in Las Vegas. A bathroom attendant called security after he saw a man taking a long time in a stall with a bag of a white powder.
Police say Mars turned over a bag containing 2.6 grams of coke - and told the arresting officer he had never used the stuff before.
Bruno Mars is up for seven awards at next week's Grammys.