Sacramento Kings star Zach Randolph just struck a pretty sweet deal in his marijuana case ... and all he has to do is a TON of community service.
TMZ Sports broke the story ... Z-Bo was arrested for felony weed possession with intent to sell back in August when cops say they busted him with more than 2 pounds of pot in Nickerson Gardens.
The charges were later reduced to misdemeanor possession of more than 1 ounce of marijuana and resisting arrest ... and Randolph was facing up to 1 year in jail if convicted on both accounts.
But now, we've learned Randolph struck a deal with prosecutors to plead no contest to misdemeanor resisting arrest ... and in exchange, the pot charge was tossed completely.
Randolph was sentenced to 150 hours of community service as part of a diversion program, which means if he completes the hours and keeps his nose clean for 12 months, the resisting arrest conviction will be wiped from his record.
One more thing ... Randolph was specifically told he may not associate himself with or be around drug dealers as part of the terms of the deal.
The case is due back in court for a progress report in December. Good luck!