A new law has been passed requiring airgun owners to hold a licence, a decade after young boy was shot dead with one.

The Air Weapons and Licensing (Scotland) Bill also places tougher regulations on pubs, strip bars, taxi firms and scrap dealers.

It comes after two-year-old Andrew Morton was shot in the head with an airgun in Glasgow in 2005.

The new licensing regime fulfils a pledge by the SNP to regulate the weapons following the tragedy.

Labour backed the Bill despite it being "far from ideal", while the Tories and the Liberal Democrats said while they supported many parts of the legislation, they could not back measures relating to the licensing of air weapons, arguing that the matter should have been addressed in a separate piece of legislation.

Justice Secretary Michael Matheson said: "We have a long standing commitment to reducing gun crime, and the licensing of air weapons has been central to that aim.

"It featured in our manifesto in 2007 and 2011, and the powers to regulate on air weapons were finally devolved to this Parliament in the Scotland Act of 2012.

"We have acted on this new power consulting widely with experts and the public.

"Our proposals have not always been universally welcomed but we believe they strike the right balance between respecting the interests of those people who shoot legitimately for work, sport, pest control or leisure, and the need to ensure that those who misuse guns do not have access to them."

Mr Matheson said the legislation was not a ban on air weapons, but would prevent those who "deliberately and maliciously" target people, animals and property from accessing them.

Alongside the introduction of the airgun licensing rules, the Bill includes wider reform of the licensing regime in Scotland, giving councils the power to reject applications for new pubs, off-licences, lap dancing clubs and private hire cars on the grounds that there are too many in the area.

The Bill also imposes new regulations on scrap metal dealers to cut down on theft, including a requirement to get proper identification from those selling scrap and refuse payment in cash.

Labour's Cara Hilton said her party backed the legislation because although it was "not without flaws", it is a "step in the right direction".

Ms Hilton's amendments to prevent 16-year-olds working as cleaners or in administrative roles in strip clubs were rejected.

She said: "I am disappointed that the Scottish Government believes it is acceptable for young people to have access to sexual entertainment venues if owners can come up with a reasonable excuse.

"I think this is a direct contradiction to a range of key Scottish Government policies."

Mr Matheson said the Government's amendment on this issue means under-18s will be banned from being in a sexual entertainment venue and "closes down" the reasonable excuse defence when sexual entertainment is taking place.

Ms Hilton added: "The new licensing regime it proposes is certainly better than what we have now.

"But I think we have got to be very vigilant in monitoring the new regime. There is a real risk in licensing these venues that the Scottish Government risks normalising what is a harmful form of sexual exploitation.

"In respect of air weapons, Scottish Labour fully support the proposals in this Bill.

"There is absolutely no doubt in my mind that these air weapons are dangerous, the tragic death of two-year-old Andrew Morton 10 years ago, and the heartache that his family continues to endure every day, highlights the real pressing need to act to prevent future tragedies."

Conservative MSP Alex Fergusson said: "For us this is a red line issue that also involves an important point of democratic principle which is that we believe that part one of this Bill should always have been a separate piece of legislation.

"We are forced on these benches into a position of being unable to support this Bill despite being very much in agreement with a large part of it."

He cited statistics showing that air weapon offences are at their second lowest level in the last decade, representing 0.06% of all reported crime in Scotland.

Mr Fergusson said: "I'm afraid I do not believe and I do not accept that this new regime will have any impact on crime statistics whatsoever.

"What we are left with is a Bill that will create a whole new layer of bureaucracy and expense, that will take up countless hours of police officers' time to bring in a licensing regime that will do nothing to reduce the minute amount of crime that a minuscule number of airgun owners or possessors currently commit.

"This seems to me to be the perfect example of taking a sledgehammer to crack a nut.

"All it will do is place an unnecessary increased burden on thousands of perfectly law abiding citizens, and that is not something that we on these benches can support."

Liberal Democrat Liam McArthur said he had sympathy for the view that the legislation was "two Bills masquerading as one".

He added: "The Government is rightly concerned about public safety but crime statistics suggest that the number of incidents involving air weapons is small and falling.

"The Bill we have before us at this stage does not strike the right balance.

"Steps may need to be taken to address inappropriate ownership and use of airguns but I fear that the proposals in this Bill are more a way of allowing ministers to claim they are taking action than an effective response to any problem that exists.

"On that basis, and despite our welcome for many of the other aspects contained in the Bill, we will not be able to support it."