Alfie Nevill, 22, of Roundhay View, hid the sawn-off 12-gauge in his laundry basket, as well as extra shells under his bed.
Despite pleas from his barrister that Nevill's home had been used against his will by drug dealers, Nevill was sentenced to a long prison term due to the seriousness of the weapon.
Police received a phonecall from a friend who was worried about Nevill's mental health on August 3, 2020.
Having entered his flat, officers found a small cannabis plant before noticing three shotgun shells under his bed. They then found the weapon hidden in Nevill's laundry basket, which was loaded with a single shell.
The court also heard that a man entered his property wearing a stab vest, but his identity or what he was doing there was not known.
Mitigating for Nevill, Christopher Dunn said: "(In cases like this) there is often a close connection with the defendant and serious criminal activity.
"This is a very, very different kind of case.
"He was vulnerable by virtue of his mental health. His accommodation is regularly frequented by people he would not want in his premises."
He went on to say this was an example of "cuckooing" - when a vulnerable person's house is used by others to commit crimes - and that Nevill was forced to hold on to the weapon for a drug dealer.
"He is naive and immature," Mr Dunn added. "He is not an individual who would be considered a public enemy."
Sentencing Nevill to five years in prison, Judge Robin Mairs said: "Guns, gun culture and gun crime is all too prevalent.
"Those who have guns use them to kill and cause fear and criminal activity. Those who have them need a safe place to hide them.
"Guns bring nothing but misery and destruction.
"You were a young man preyed upon by others who exploited you.
"While I may have sympathy for you, it's clear from the legislation this is a case where the minimum term applies."