The government has banned the popular gay drug poppers, amid extraordinary scenes in the Commons.

MPs used an amendment by shadow home secretary Andy Burnham to try to exclude poppers – chemically known as alkyl nitrites – from the psychoactive substances bill, but they lost by 228 votes to 309.

However, Home Office minister Mike Penning said the government would review evidence of harm about popper use and come to a decision whether to make the drug legal again before summer recess.

Under the psychoactive substances bill, no-one would be breaking a law by possessing poppers, but anyone selling it to them would be subject to criminal charges.

It would spell the end of the relaxed rules around the drug, which see is sold freely on British high streets.

The debate saw gay Tory MP Crispin Blunt come out as a poppers user, as he called on the government not to "do something fantastically stupid".

The Reigate MP said: "There are some times where something is proposed which becomes personal to you and you realise the government is about to do something fantastically stupid.

"I think in those circumstances one has a duty to speak up.

"I use poppers. I out myself as a popper user and will be directly affected by this legislation.

"I am astonished to find it is proposing to be banned – frankly so would very many other gay men.

"My instant reaction to this is it serves to bring the whole law into disrepute.

"Choosing to ban this, which I have been using and I know has been used … for decades, then respect for the law is going to fly out the window for people if that's the drug that they use."

The respected home affairs committee had already warned against banning the drug, following advice from the Home Office's own advisory body saying it was not capable of causing a "societal problem".

But the Home Office has been gradually freezing its advisors out of drug legislation debates recently, as it uses the psychoactive substances bill to outlaw all mind-changing substances unless they are specifically exempted.

Ministers will be keen not to grant poppers an exemption on the basis of its lack of harm, because doing so would raise questions about the proposed ban on laughing gas, which has also been found to be largely safe for public use.

In a letter to Theresa May, Burnham wrote: "I remain concerned that your new position (to ban poppers pending further investigation) may well cause harm, particularly amongst the gay community.

"A ban on poppers, even if temporary, may result in poppers being sold 'under the counter', and users being driven underground to purchase poppers and thereby being exposed to new, more dangerous substances.

"It could also result in individuals facing prosecution and possible imprisonment.

"A temporary ban will cause widespread confusion amongst users about their legality, as well as having potentially serious and life changing consequences for individuals who continue to use them during the ban."

The Home Affairs committee heard evidence from the National AIDS Trust and others, that a ban on poppers would increase the spread of sexually transmitted diseases, as well as forcing current users into the hands of drug dealers.

A ban would also remove alkyl nitrites from any regulatory regime meaning a currently safe substance, could in future become unsafe for users.

The ban could also hinder the legitimate use of these substances for medical research and therefore delay the development of new life-saving treatment.

Poppers are typically sniffed out of small bottles for a short-lived head rush and an increase in sexual pleasure.