The Fireworks and Pyrotechnics (Scotland) Act will also see attacks on emergency workers using fireworks become “aggravating factors” taken into account when courts sentence offenders.
Work is also under way to bring in a licensing system, mandatory training for people wishing to purchase fireworks, and powers for local authorities to designate firework control zones.
Last year, steps were taken to restrict the times fireworks can be used, when they can be bought, and the quantity.
Community safety minister Ash Regan said the moves are a welcome stop to bring greater public safety across Scotland.
“These important new powers have been delivered at pace and make it a criminal offence for anyone to supply fireworks or other pyrotechnic articles to a child or person under age 18,” she said.
“Fireworks in the wrong hands can cause serious, life-changing injuries or even prove lethal.
“Any attack on fire, ambulance and police crews is utterly despicable so ensuring courts are required to take into consideration the use of fireworks or pyrotechnics as a possible aggravating factor in any attack on 999 crews is a real deterrent to such vile behaviour.
Chief Inspector Nicola Robison, from Police Scotland’s partnerships, preventions and community wellbeing division, said the force’s message is “do not risk it” as offenders could face a £5,000 fine, six months in prison – or both.
“Fireworks, when not used lawfully, present a significant risk to the public and so preventing such items from being purchased by, or for, anyone under the age of 18 is vitally important for keeping communities safe,” she said.
“The new aggravator for attacks on emergency service workers is also a welcome legislative change and should give all frontline first responders additional reassurance that their safety and wellbeing is paramount as they go about their duties.”
Over recent years in Glasgow and Edinburgh, emergency crews have been targeted by gangs of thugs as they tried to quell burning motors, out of control bonfires and other blazes. Pyrotechnics have been aimed at 999 workers and passing vehicles.