A stone-faced Snoop Dogg pleaded no contest to felony gun and drug charges, avoiding what could have been a years-long prison sentence.
The 35-year-old rapper, born Cordozar Calvin Broadus Jr., on Wednesday agreed to five years' probation and 800 hours of community service. He faced charges of gun possession by a felon and sale or transportation of marijuana.
Snoop Dogg's recent arrests marked the end of a relatively long trouble-free stretch for the rapper. He has burnished his image in recent years with appearances in mainstream movies and by starting a youth football league.
He was arrested at Bob Hope Airport in Burbank on Oct. 26 on suspicion of transporting marijuana. Police later found a gun at his home. If convicted at trial he could have faced up to four years in prison.
Judge Terry Smerling placed conditions on Snoop Dogg's probation including that only 400 hours of community service could involve his youth football league.
The judge also ruled that Snoop Dogg could not have any gang members in his entourage, must provide authorities a DNA sample and he must have a medical permit if he uses marijuana.
The rapper caused a sensation Wednesday when he arrived in a fur-collared black leather jacket, T-shirt and sequined jeans, and teenagers shrieked as he came down a hallway to the courtroom.
Defense attorney Donald Etra said outside the court that Snoop Dogg smokes marijuana because he has migraines and has a medical permit under state law.
Etra said Snoop Dogg's security staff and drivers and his entourage do not include gang members.
"Snoop's position is he wants to give children and teenagers an example to follow," Etra said of the football league.
Etra said that Snoop Dogg "recognizes he got a great deal" given his prior convictions.
If he violates probation he will be sentenced to three years in state prison.
Snoop Dogg also faces separate felony charges stemming from the Sept. 27 discovery of a collapsible baton in his computer bag by a security screener at John Wayne Airport in Orange County.
Authorities allege the baton was a dangerous weapon. Snoop Dogg has said it was a prop for a video he was filming in New York, and pleaded not guilty.
Snoop Dogg was convicted in 1990 of cocaine possession and charged with gun possession after a 1993 traffic stop. In 1997, he pleaded guilty in exchange for three years' probation and a promise to make public service announcements against violence.
He was acquitted of a murder charge in 1996 after the death of an alleged street-gang member killed by gunfire from the vehicle in which Snoop Dogg was traveling.