James Hurst of the Orchards in Leyland was sentenced at a hearing on May 12 at Preston Crown Court.
Hurst was handed two 18-month sentences for class A drugs offences to run consecutively, and a further five years for firearms offences.
The 29-year-old was arrested as part of a "lengthy drugs operation" carried out by South Ribble Neighbourhood Policing Team.
A spokesman for the police said: "Hurst has been involved in the supply of the class A drug cocaine across Leyland.
Video shows man in van wielding weapon in Preston city centre fight
Dramatic reduction in speed limit on major route into Preston through South Ribble
Lewis Turner inquest: moped rider "travelling at motorway speeds" on residential New Longton road and without fastened helmet before fatal crash
Real Housewives of Cheshire: former star of hit TV show set to visit Chorley boutique
Lancashire Police investigate after man found critically injured outside Preston’s Harris Museum
"He was sentenced to 18 months for the drug supply offence and a further five years for possession of a Taser device which he claimed was for self defence.
"We are committed to targeting those who supply controlled drugs and feel the need to carry weapons on our streets."
Hurst pleaded guilty to all charges at an earlier hearing.
Anyone with information about a crime can call CrimeStoppers, free and in confidence, on 0800 555 111.