Bruno Mars, famous for his hit song Just the Way You Are, pleaded guilty to a felony cocaine charge in Las Vegas.
Bruno Mars was arrested last September after a bathroom attendant at the Hard Rock Hotel & Casino told police a man was in the bathroom doing drugs. That man turned out to be 25-year-old Mars, who had performed at the Hard Rock that night.
Mars gave police the 2.6 gram bag of cocaine and told police he had (ahem!) never done drugs before.
The Las Vegas judge told Mars, whose real name is Peter Hernandez, that his record will be clean if he stays out of trouble for one year.
Mars struck a plea deal that requires him to spend one year on probation, pay a $2,000 fine and do 200 hours of community service, as well as drug counseling.
"We're extremely pleased the charge against Bruno is going to be dismissed," his lawyer said.
The Grenade singer is nominated for seven Grammy awards, including best male pop vocal.
More on Bruno Mars:
Britney Spears gives up Billboard top spot to Bruno Mars
Bruno Mars facing felony cocaine charges
Glee's Jane Lynch hosting SNL with Bruno Mars