Airgun owners will have six months from July to ensure they have a certificate for their weapon.
New laws requiring airguns to be licensed are due to come into force at the end of the year after a lengthy campaign in the memory of toddler Andrew Morton.
The two-year-old died in Easterhouse from an airgun pellet in 2005 and tougher rules, dubbed “Andrew’s Law” had been a long-standing cross-party political commitment but it took until 2015 before it was passed into law.
Figures from 2013-14 showed offences involving air weapons made up almost half of all crimes with a firearm.
After December it will be an offence to have an air weapon without the required certificate or permit. Those found guilty of breaching the new laws could face a fine or, in some cases, imprisonment of up to two years.
Owners will be able to apply to Police Scotland for a certificate or permit from 1 July.
With an estimated 500,000 unlicensed air weapons in Scotland, police will also be running a campaign to allow people to surrender any unwanted airguns before licensing takes effect.
Justice secretary Michael Matheson said: “This government has a long-standing commitment to eradicating gun crime and this new legislation will take these potentially lethal weapons out of the hands of those who would misuse them.
“Every day, police, the public and animal welfare groups have to face the results of air weapon misuse, from anti-social behaviour to horrific and deliberate injuries to wildlife, pets and very occasionally people.
“We are not banning air weapons outright, but ensuring that their use is properly regulated and users have a legitimate reason for them. We believe this legislation strikes the right balance between protecting communities and allowing legitimate shooting in a safe environment.
“I would encourage anybody with an air weapon to stay on the right side of the law by using the six months from 1 July to apply for the right to possess an air weapon.”
The Air Weapons and Licensing (Scotland) Bill also contains tougher regulations on pubs, strip bars, taxi firms and scrap dealers.
Sharon McMillan, the mother of Andrew Morton, said: “I know it isn’t an outright ban, but it is the next best thing to it. I would love to see the guns banned altogether, but I know that farmers and pest control need it for work. We have a good future to look forward to, knowing that we have actually achieved something for [Andrew].”