Retired mechanic Wilson Barrett, 72, grabbed the gun, which had been gathering dust in a corner of his workshop, after finding that grey squirrels had invaded the roof space of his house and caused "considerable damage", Falkirk Sheriff Court was told.
His pot shots were heard by a neighbour - who raised the alarm.
Ann Orr, prosecuting, said Barrett had been seen by neighbours with the air rifle at his house in Glasgow Road, Camelon and the police were called.
Mrs Orr said: "He confirmed he didn't have a licence for it and it was seized."
He was cautioned and charged and made no reply.
Yesterday, Barrett, a first offender, pleaded guilty to possessing the weapon without a certificate.
The prosecution accepted his plea of not guilty to a second charge, of "recklessly discharging the weapon, in the direction of communal gardens, to the danger and risk of injury to the lieges".
Defence solicitor Dick Sandeman said it was "a rather unusual matter".
He said: "Mr Barrett used to have this rifle in his workplace. It had been there for 20 years, forgotten about in a corner.
"He had certain difficulties with grey squirrels in his property. They had entered the loft space, chewed through electrical cables, and caused significant damage to the wiring.
"He remembered about this air weapon, brought it home, and he was shooting at a grey squirrel when this was heard by a neighbour and reported to police.
"It's as simple as that."He said the airgun was a .22 calibre, and "not a powerful, high-velocity weapon".
Sheriff Simon Collins QC fined Barrett £350, and ordered the forfeiture of the air rifle and pellets.
He said the maximum sentence he could have imposed would have been 12 months imprisonment.
He said: "It seems to me that the public interest in requiring a licence for the possession of weapons, including air weapons, is considerable, and the available penalty, even on summary complaint, rather reflects that."