(CNN) A man from suburban Chicago was sentenced to four years in prison after he ordered 42 pounds of marijuana-infused chocolate from California with the intention of selling it, the Kane County state's attorney's office said in a statement.

Thomas J. Franzen, 37, pled guilty to possession of more than 5,000 grams of cannabis, a felony that carries a prison term of four to 15 years and a fine of up to $25,000, according to court records.

In February 2014, postal workers noticed a pattern of suspicious packages being delivered to Franzen's home in Montgomery, Illinois, the state's attorney's office said. After obtaining a search warrant to open a package, they found more than 19,000 grams of chocolate infused with THC.

Authorities then got a warrant to search Franzen's home and found cocaine and more than 100 additional grams of marijuana, along with items that are "known to be evidence of drug dealing," the state's attorney's office said. Those items included a digital scale, more than $2,000 in cash and postal receipts for packages he had mailed to locations across the US and Canada.

Franzen's attorney, David Camic, said his client has had testicular cancer and was undergoing treatment for it at the time that he ordered the marijuana.

Read More