All in all, not a bad day for Snoop Dogg. He can keep his marijuana—and stay out of jail.

The rapper-actor pleaded no contest Wednesday to felony gun and marijuana violations stemming from a pair of arrests last fall.

In exchange, Snoop, born Calvin Broadus, was sentenced to five years of probation and was ordered to log 800 hours of community service.

A three-year prison sentence was suspended. And Snoop's medical marijuana certificate, as issued by the state of California, was left intact.

Snoop's attorney Donald Etra said Wednesday that his client uses marijuana as a medicinal treatment for migraines. Per the state license, Etra said, Snoop is allowed to be in possession of up to eight ounces of the weed.

It was not announced, and Etra said not it was not precisely determined, how much marijuana the Starsky & Hutch star had on him when he was busted for illegal transport of the drug and possession of a firearm last Oct. 26 at the Bob Hope Airport in Burbank, California.

Snoop's no-contest plea also took care of a follow-up arrest in Burbank that occurred last Nov. 28 following the star's appearance on NBC's Tonight Show.

"Snoop accepts full responsibility for these matters," Etra said.

Not that Snoop's camp didn't want to point out a couple of things.

First, an Etra statement noted that while Snoop understands that, as a convicted felony, dating back to a pair of cases in the early 1990s, he can't lawfully possess a firearm in California, "he has every reason to seek security and protection."

Then, it noted that while Snoop accepts he can't carry around more migraine antidote than his state-mandated fair share, he "possesses a medical marijuana certificate."

Snoop accepted his probation and community-service sentences in person in a Burbank courtroom. In the fashion judgment of the Associated Press, the 35-year-old star "caused a sensation...in a fur-collared black leather jacket, T-shirt and sequined jeans."

Per the sentencing, Snoop can burn off up to half of his community-service time through his Los Angeles youth football league, the aptly named Snoop Youth Football League.

Still unresolved is a matter involving a fold-up baton that led to Snoop's arrest at the John Wayne Airport in Orange County, California, last Sept. 27.

A hearing in that case is scheduled for May 15. According to Etra, there are no current plea talks, owing to a fundamental disagreement: Prosecutors maintain the baton is a deadly weapon; Snoop's side maintains it is a prop.