AIR gun owners who want to keep their weapons have until the end of this year to get a license.

The new law to control access and ownership of air guns comes into force on July 1 and from then applications can be made.

By December 31 all air gun owners must have a certificate or permit otherwise the gun is illegally held and offenders could face up to two years in jail or a fine.

The new law was passed by MSPs following a long running campaign sparked by the death of Glasgow toddler Andrew Morton.

Two year old Andrew was shot in the head by Mark Bonini, then aged 27 in Easterhouse in 2005. Bonini was jailed for life to serve at least 13 years for his death.

Michael Matheson, Justice Secretary laid out the dates for licensing of the guns in the Scottish Parliament.

There are estimated to be around half a million unlicensed air guns in Scotland which Mr Matheson said the act aims to ensure they do not fall into the wrong hands.

He said: “This new legislation will better protect our communities by taking 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 to continue.”

Police said anyone with a gun they do not wish to register and do not want to keep should hand it in before the deadline.

Mark Williams Assistant Chief Constable said: "Police Scotland fully supports the changes to air weapon legislation and in support of these developments will launch an air weapons surrender campaign later this year. This will allow people to hand in any unwanted air weapons before licensing takes effect."

He said there will be an information campaign to make people aware of the changes and what they mean.