Matt Sayles, Associated Press
In this Wednesday, Nov. 30, 2011 photo, Bruno Mars announces the nominees for best new artist at the Grammy Nominations Concert in Los Angeles. Mars was cleared of a felony cocaine possession case in Nevada on Wednesday, Jan. 18, 2012, after his attorneys told a state court judge the Grammy-winning pop star stayed out of trouble and met other conditions of a plea deal reached almost a year ago.

LAS VEGAS — Pop star Bruno Mars was cleared of a felony cocaine possession case on Wednesday, after his attorneys told a judge the Grammy-winning pop star stayed out of trouble and met other conditions of a plea deal.

Clark County District Court Judge Jessie Walsh dismissed the case against the 26-year-old singer-songwriter of hits including "Just The Way You Are" and "It Will Rain."

Mars, whose real name is Peter Gene Hernandez, didn't appear in person for the hearing in Las Vegas.

He pleaded guilty last February to cocaine possession, but the judge postponed accepting the plea. Mars didn't get formal probation, but the judge fined him $2,000 and ordered him to perform 200 hours of community service and eight hours of drug counseling.

Mars acknowledged having 2.6 grams of cocaine when he was arrested in a bathroom in September 2010 after a nightclub performance at the Hard Rock Hotel & Casino in Las Vegas.

He could have faced up to four years in state prison.

His attorneys, Blair Berk, has said the singer appreciated the chance as a first-time offender to have the felony charge dismissed.

"Bruno earned the dismissal," Berk told reporters after the hearing. "He exceeded the expectations of the court."

Mars won best male pop vocal performer at the Grammys last year and is nominated for six awards and is due to perform at the upcoming awards show Feb. 12 in Los Angeles.