OCALA, Fla. -

A convicted criminal who tossed a gun into a nearby trash can as deputies approached him has received a lengthy prison sentence.

A federal judge in Ocala on Wednesday sentenced 31-year-old Christian Labrent Moore to 17 years in prison stemming from his arrest. Moore pleaded guilty in June to possession of a firearm and ammunition affecting commerce by a convicted felon.

The Ocala Star-Banner reports Moore was in federal court due to his record of violent and drug-related crimes. He qualified for an enhanced sentence as an "armed career criminal."

Deputies saw Moore toss the gun into a trash can as they approached him during a search. He told deputies he'd just received it in a drug trade. As a convicted felon he wasn't supposed to have a gun.