Huff, 25, accepted a conditional plea, meaning he'll get six months' probation and have the charge wiped from his record as long as he completes the program, according to his attorney, Andrew Smith.
The news was first reported by TMZ and confirmed by ESPN.
"He has done everything right," Smith told ESPN. "He has cooperated, been upstanding and has every intention of remaining compliant. And we applaud the Camden County Prosecutor's office for their efforts and understanding of this sensitive matter."
Smith added: "Josh purchased the gun in Texas legally, was properly licensed to carry in Texas and those factors were appropriately considered by the Camden County Prosecutor's office."
On Nov. 1, Huff was pulled over for speeding on the New Jersey side of the Walt Whitman Bridge. Police found an unloaded 9 mm handgun in Huff's possession. They also detected an odor of marijuana. He was arrested and charged with DUI, unlawful possession of a weapon and possession of a small amount of marijuana.
Huff was released by the Eagles on Nov. 3 and signed by the Bucs on Nov. 7. He saw action in three games with the Bucs last season, finishing with three catches for 41 receiving yards. He put up 72 yards on six kick returns, averaging 12.0 yards per return.
Huff spent several days with quarterback Jameis Winston, along with several Bucs teammates, working out in Houston recently. Huff was also at the team facility Monday for the start of the offseason program.