ALBANY, N.Y. (AP) — A 44-year-old man who accidentally shot himself in the leg while driving his Cadillac SUV is going to prison for illegally possessing a handgun and crack cocaine.

Edwin Ferrer of Schenectady (skeh-NEHK'-ta-dee) was sentenced in federal court on Monday to 63 months behind bars. He was convicted by a jury after a three-day trial in March.

Ferrer was arrested in December 2015 after investigators searched his vehicle and found his pistol, six rounds of ammunition and a small amount of crack cocaine. As a felon, he was prohibited from having the gun and ammunition.

More From WIBX 950