Snoop Dogg has avoided a jail sentence after pleading no contest to gun and drug charges in a Californian court
The 35-year-old rapper, whose real name is Cordozar Calvin Broadus Jr, was given five years probation and 800 hours of community service.
Superior Court Judge Terry Smerling also ruled that the star must not have any gang members in his entourage.
The musician was arrested in October and charged after he was found in possession of a gun and drugs.
Defence lawyer Donald Etra said Broadus was grateful for the sentence. "He recognises the severity of this," he said.
"He recognises he got a great deal and he fully intends to make sure nothing prohibits him from keeping his part of the bargain."
Broadus was also told that only half of his community service could be with the youth American football league he runs.
The charges date from an incident where police discovered marijuana in the rapper's car while confronting him over a parking violation at Burbank's Bob Hope airport.
The gun charge was added after the weapon was discovered at the rapper's home by police, authorities said.
Broadus was convicted of felony drug charges in 1990, making it illegal for him to own a firearm. Prosecutors said before the hearing that he could have been imprisoned for up to four years.
The rapper has separate outstanding cases in other parts of California.
He pleaded not guilty to possession of a deadly weapon in January after an outlawed collapsible police baton was found in his luggage as he attempted to catch a flight to San Francisco in September last year.
He was also arrested in Los Angeles on November for weapon and drugs possession offences.
Last month Broadus was arrested in Sweden for suspected drug use.
Snoop Dogg pleads no contest to 2 felony charges
Snoop Dogg: Rappers' Hos Are Different
Snoop Dogg on Imus: Rapper's Ho's Are Different (Video)