John Douglas Murray had previously served a prison sentence of between three months and three years, which earns an automatic ban from owning firearms for five years from the date of release.
The 38-year-old was arrested for the latest offences after several residents, including a taxi driver, reported seeing a man who appeared to be drunk carrying a rifle in a carrier bag in the Sutton Hill and Donnington areas of Telford, on December 5. A police investigation was launched and he was identified by officers checking street cameras.
Sentencing him, Judge Anthony Lowe said: “The message has to go out loud and clear that if you have guns, even guns like these, you are going to prison.
"The aggravating factor is the gun is capable of being lethal. I think there is a large amount of ammunition involved.
“You were wandering round drunk with it. You hid it and put it in a garden where I am told the child at the property would not have accessed the garden without supervision.
“If a child had found it there consequences could have been serious.”
Murray admitted possession of a rifle without a certificate, possession of a cartridge with a bullet without a certificate and possessing a firearm while prohibited.
Shrewsbury Crown Court heard Murray had stayed overnight at a property, in Queens Road, Donnington.
After he left, the householder checked the garden and discovered a package containing the .17 calibre gun and 68 rounds of ammunition, and telephoned the police.
Officers also found a cartridge containing a bullet during a street search in of Sutton Way, in Sutton Hill.
In mitigation, Miss Debra White said such guns were used by farmers and gamekeepers and Murray himself had accepted he made a poor decision when he took possession of the weapon, which was not fitted with a magazine which would enable it to rapid fire.
Murray, of Blakemore, Brookside, was jailed for a total of 18 months. He must serve half minus time spent in custody before being released on licence.
He denied the theft of a bottle of wine from Asda relating to the same date which will lie on file.
The judge also ordered the forfeiture and destruction of the firearms.