Nick Ut / AP 1 / 3

LOS ANGELES (AP) -- An aspiring rapper who was arrested during a search of Justin Bieber's mansion has pleaded no contest to felony possession of ecstasy.

Like us on Facebook?

Prosecutors said Xavier Domonique Smith, also known as Lil Za, was sentenced Wednesday to three years of probation, 20 days of community labor and a drug-treatment program.

If the 20-year-old Smith successfully completes the sentence, the charge can be reduced to a misdemeanor.

His attorney, Shawn Holley, did not immediately return a phone message.

RELATED: Amazing celebrity career comebacks

Smith was arrested in January after deputies said they found him with drugs while searching Bieber's mansion for evidence in an egg-tossing vandalism case.

RELATED: Justin Bieber's tattoo guide

Santiago says Smith was also ordered to pay $600 to replace a phone he broke while in custody.