The Taurus self-loading pistol was intercepted and seized by Border Force officers at Stansted Airport in July 2023.
It was hidden inside the packaging for a metallic safe box, along with two empty 9mm magazines.
48-year-old McNeil Colly pleaded guilty to possession of cannabis with intent to supply and has been jailed for 17 years.
35-year-old Keston Redhead, an asylum seeker from Trinidad and Tobago, was also jailed for 17 years and will be deported afterward.
Analysis of messaging data on their phones evidenced both men were involved in importing the handgun, as well as illicit drugs, from the USA and Trinidad respectively.
Messages between the pair included an invoice for the metallic safe box, the shipping label for the package containing the handgun, and details of money transfers overseas.
They also exchanged photos of firearms and vacuum-sealed blocks of cocaine.
A search was conducted at Colly’s Streatham flat and a samurai sword, machete and crossbow were found in his bedroom.
Officers also seized eight kilos of cannabis and drug supply paraphernalia including a mechanical press and weighing scales.
NCA Senior Investigating Officer Chris Hill said: “Colly and Redhead conspired to import harmful drugs and a self-loading pistol into the UK, using false names and delivery addresses in their attempt to evade detection.
“Our successful investigation has resulted in the seizure of a deadly firearm and class A drugs, and the imprisonment of two organised criminals.
“The impact of gun and drug crime on our communities is devastating. We are committed to stopping the availability of lethal weapons to the criminal underworld and intercepting drugs before they reach street-level dealers”.
Specialist Prosecutor Caroline Hughes of the CPS said: “Keston Redhead and McNeil Colly compromised public safety by importing drugs and a firearm into the country.
“Thanks to the work of the National Crime Agency after the gun was seized at Stansted Airport, we were able to build a strong case against them which proved their crucial roles in arranging the importation of class A drugs and a firearm into the UK resulting in their convictions following a trial”.