IT was a recreational drug for the middles classes as far back as the early 1800s, but in recent years nitrous oxide has emerged as the legal high of choice among teenagers and twenty-somethings at music festivals and house parties.

Nicknamed "hippy crack" but probably best known as laughing gas, nitrous oxide has a range of legitimate medical and commercial applications. It is the pain-relieving ingredient behind the "gas and air" handed out to mothers during childbirth or administered by dentists during tooth extractions and root canal surgery.

In the drag racing industry, it is used as propellant to turbo-charge vehicles and, more mundanely, it is the reason "skooshy" cream sprays from canisters already whipped.

But under the Psychoactive Substances Bill currently passing through the UK Parliament - and which will apply equally in Scotland once it passes into statute - the supply of nitrous oxide for recreational purposes will be criminalised along with the other mood-altering, but not currently illicit, substances which have become increasingly popular among the young. Possession, in small quantities, will not be an offence.

The sweeping legislation will leave only alcohol, nicotine and caffeine exempt - and there are plenty of people unhappy about it.

Yesterday, some 1500 demonstrators gathered in Parliament Square in London to inhale nitrous oxide en masses from balloons as part of a protest to "stand up for your right to alter your consciousness".

Breathing in nitrous oxide stimulates a brief but profound sense of euphoria among users. They will sometimes black out, bursting into laughter as they come around. Dissociation, sound distortion, hallucinogenic effects and dizziness are also among its effects, with some users report a sense of well-being lasting up to half an hour.

Its growing popularity is evident in the huge demand online for party goods stockists who sell the nitrous oxide canisters used to inflate balloons, with dozens of gas cylinders worth thousands of pounds also stolen this year from hospitals including Dr Gray's in Aberdeenshire and Dumfries and Galloway Royal Infirmary.

It is now the second most popular recreational drug in Britain after cannabis, with more than 400,000 16- to 24-year-olds reporting using it between 2013 and 2014.

The Psychedelic Society of London, one of the groups behind the protest, argue that nitrous oxide is being demonised when binge drinking is arguably a bigger cause of deaths and injuries among young people.

Organiser Stephen Reid said: "This is intended to make a serious point about the bill and the huge infringement of liberty that entails and about the fact that this bill is going to do more harm than good.

"It's going to make it harder for people to access education, it's not going to reduce the number of people taking these things and the sensible solution has to be legal regulation of these drugs."

Professor David Nutt, former drugs tsar and professor of neuropsychopharmacology, said the move to ban laughing gas was "rather bizarre".

He said: "It's probably one of the safest recreational substances there has ever been.

"It's been used for over 200 years, largely as an analgesic, a pain killer. It's been used by writers like Coleridge and philosophers like James to get insights into the brain and now it's being used by young people as an alternative to alcohol on the grounds that it's a lot safer than alcohol and a lot shorter acting."

However, in rare instances misuse of nitrous oxide can have serious or even deadly side effects.

Regular use can can cause anaemia or vitamin D deficiency, linked to mood swings and depression. There is also a risk of vitamin B12 deficiency which has the potential to cause severe and irreversible damage, especially to the brain and nervous system.

According to the Office for National Statistics, nine deaths were linked to the substance between 2006 and 2012.

The primary danger associated with the gas is hypoxia - where the body is deprived of oxygen, in fatal cases causing fatal brain damage.

Professor Neil McKeganey, of the Centre for Drug Misuse Research in Glasgow, said he supported moves to clampdown on the trade of nitrous oxide, along with other legal highs which had earned a "worrying cultural acceptance".

He said: "These drugs are increasingly being sold on the streets in Scotland and elsewhere in the UK. There is a perception that if they are dangerous, they wouldn't be being sold.

"I think it's quite right that the government is doing all it can to tackle those substances, but I don't think anyone in government or elsewhere should entertain the notion that this will the total answer to these substances because we know the internet is a mechanism for increasing this trade, and that will be a different and much more difficult nut to crack."

He added that attempts to curtail the sale had parallels with tackling solvent abuse, where the sale of glue and aerosols is similarly impossible to ban.

"The purveyors of legal highs have consistently hidden behind the statement that these drugs are not for human consumption while doing all they can to trade these drugs for human consumption," said Prof McKeganey. "Realistically, we do have to recognise that the fact nitrous oxide has a legitimate medical and commercial use it has to be seen as entirely separate from its trading as a recreational drug and it's the latter that the psychoactive substances bill will tackle."

Katy MacLeod, national training and development officer for the Scottish Drugs Forum, said that the majority of adverse incidents involving nitrous oxide consumption occurred when it was mixed with large quantities of other drugs and alcohol.

She added: "The new NPS bill will help restrict the supply of nitrous oxide, however, given it has legitimate uses, in the catering and other industries, prosecutions may prove difficult. Nitrous oxide is generally banned at festivals across the UK; however, it remains a difficult substance to police despite strict on site protocols.”