A plasterer was caught with a submachine gun capable of firing multiple missiles.
Christopher McAlpine, 36, was stopped by police fleeing from a taxi in Paisley, Renfrewshire on May 18, 2021.
A rucksack containing a Skorpion pistol and 40 bullets was found abandoned in the footwell of the cab.
He had earlier been under police surveillance, leaving co-accused Steven Drummond’s property with an item hidden in his clothing.
On Thursday, the pair pled guilty at the High Court in Glasgow to possession of the submachine pistol.
McAlpine and Drummond, 36, also admitted possession of bulleted cartridges without holding a firearm certificate.
Co-accused David Stevenson, 51, pled guilty to being concerned in the supply of cocaine.
The court heard officers carrying out surveillance on McAlpine saw him enter Drummond’s home.
He left minutes later with a “bulky item” in his jumper before entering a taxi which was stopped by police.
McAlpine tried to flee the scene but was detained before telling officers: “Stevie handed me something there.”
A black rucksack was found in the taxi which was searched at the police station.
Prosecutor Kath Harper said: “Within the rucksack were packaging containing a firearm and ammunition.
“A blue plastic bag containing white powder which was tested negative for drugs and further ammunition were recovered.”
The advocate depute told the court that the gun was able to discharge semi and fully automatic modes.
She added: “It was designed or adapted that two or more missiles can be successively discharged without repeated pressure on the trigger.”
A total of 40 9mm bulleted cartridges which were live and suitable for the firearm were also found.
Drummond was later arrested after his DNA was found on swabs inside the rucksack and edges of the cartridges as well as the ammunition located.
Stevenson’s home was raided and a total of £123,000 of cocaine and adulterant weighing 2.7 kilos was recovered.
Further items such as scales, cling film and other drug paraphernalia was also found.
Stevenson’s DNA was found on the padlock of a locked cupboard in his close where some of the drugs were stored.
It was revealed that Stevenson – a taxi driver – has five road traffic convictions.
Drummond also has road traffic convictions while McAlpine’s record includes crimes of dishonesty.
Sentence was deferred pending background reports until next month by judge Lord Braid.
The trio were remanded in custody meantime.