Public health minister Maureen Watt announced yesterday that the measure would be included in the forthcoming health bill, which is due to be introduced later this year.
It would also make it an offence for an adult to buy e-cigarettes for a minor.
Concerns have been raised previously over the safety of the electronic devices, and whether the futuristic design and range of flavours would encourage young people to start smoking conventional tobacco.
The bill also includes measures to make it a statutory offence to smoke within hospital grounds, which could be punishable by fines of up to £1,000.
Hospital premises across Scotland became smoke-free on 1 April but NHS Greater Glasgow and Clyde was the only health board to employ enforcement wardens.
Ms Watt said: “E-cigarettes might have a place when it comes to helping current smokers to quit their habit.
“This government is not opposed to e-cigarettes, but we think it is right to protect children from nicotine addiction, and to limit the prevalence of smoking behaviours. Through this bill we will seek to strike that balance.”
The news has been welcomed by campaigners at anti-smoking group Ash Scotland, who called for an change in attitudes towards smoking. Chief executive Sheila Duffy said: “Although e-cigarettes are likely to be far safer than smoked tobacco, there are still some unknowns and risks including the risk of addiction.
“Regulations to protect children from companies who will be looking to target them as future consumers are welcome.
“For existing smokers who are struggling to quit, e-cigarettes could be an alternative. Some smokers have found that these devices mimic the experience of cigarettes closely enough to allow them to move on to using these less harmful devices instead of cigarettes.
“I’d like to see this legislation walk the tightrope of protecting our children from commercial companies selling recreational nicotine, while at the same time facilitating adult smokers to be free from tobacco.”
Her concerns were echoed by Scottish Conservative health spokesman Jackson Carlaw MSP, who said e-cigarettes were a valuable tool for kicking the habit.
Mr Carlaw said: “The Scottish Conservatives will support any moves which protect the health of young people – including the banning of the sale of e-cigarettes to under 18s as they could all too easily be a route into the dangers of smoking generally.
“However, we also need to see a regulatory framework for e-cigarettes which ensures the delivery devices sold are safe while at the same time acknowledging their potential use in smoking-cessation programmes.”
He said concerns over enforcing the new smoking rules around hospitals had been justified and criticised “dubious enforcement procedures” which he said would not help people quit smoking.
Mr Carlaw added: “Politicians of all parties are committed to reducing smoking and ensuring healthy practices are observed in our hospitals but bans with dubious enforcement procedures, increasingly favoured by the SNP when it comes to public health, are no substitute for actions which encourage smokers to give up.”
The bill will also place a duty on health and social care organisations to be open and honest when an incident involving physical or psychological harm has occurred.