The European Union has struck a deal which could curb the booming market in electronic cigarettes and lead to an EU-wide ban on a popular version of the nicotine device.

In hard-fought negotiations between the 28 governments of the EU and the European parliament, both sides agreed on Tuesday that refillable e-cigarettes could be banned across Europe if three countries decided on prohibition.

The parliament, under intense lobbying from the tobacco industry, took a more liberal line than the European commission, which proposed that e-cigarettes be legislated for in the same way as pharmaceuticals. That was rejected in the compromise, but individual countries were left free to regulate e-cigarettes as medicines.

Governments also took a more restrictive position on the issue and could still try to reverse some of the agreed elements. Ambassadors from the 28 countries will meet on Wednesday to decide whether to accept the compromise or return to negotiations.

The issue of e-cigarettes quickly became the most contentious aspect of new EU rules on the packaging and sales of tobacco products, although the electronic devices contain no tobacco.

Public health warnings and graphic images of the damage done by smoking are to cover two-thirds of cigarette packaging, and cigarette flavourings are to be proscribed, if gradually phased out.

Martin Callanan, leader of the Conservatives in the European parliament, said: "This is a perverse decision that risks sending more people back to real, more harmful, cigarettes. Refillable e-cigarettes would almost certainly be banned, and only the weakest products will be generally available. As many smokers begin on stronger e-cigs and gradually reduce their dosage, making stronger e-cigs harder to come across will encourage smokers to stay on tobacco."

The key question centred on the impact of e-cigarettes and whether they encouraged people to start smoking or whether they weaned nicotine addicts off tobacco.

"It's inhaled. It's direct inhalation of nicotine into the lungs. That creates an addiction very fast," said a senior diplomat involved in the negotiations. "It encourages a switch to real cigarettes."

The European e-cigarettes market is currently estimated at €2bn (£1.7bn), but it is growing fast, with approximately seven million users.

In the UK some 1.3 million of an estimated current 10 million smokers have switched to the electronic devices. Celebrity endorsements and social media are attracting young people to use e-cigarettes in large numbers, according to a recent report commissioned by Cancer Research UK.

But public health experts are sharply divided about the devices: some argue that they could substantially cut deaths from tobacco – currently 100,000 annually in the UK – while others warn they will only glamorise smoking, especially among the young.

One study of 657 smokers, published in the Lancet last month, found that e‑cigarettes worked as well as nicotine patches in helping people stop smoking within six months.

France, which has an estimated 1.5 million e-cigarette users, is currently pondering a ban, but a mayor in Normandy has already introduced a local ban.

The EU agreement allows e-cigarettes with a nicotine content below 20mg/ml to be regulated for general sale, rather than treating them as medicinal products. Governments had demanded a 3mg/ml limit.

The deal, however, lets individual governments regulate the cigarettes as medicinal products if they choose.

Refillable cartridges became the biggest sticking point, with the parliament threatening to veto the legislation if replacement sales were banned. On refillable e-cigarettes, the compromise allows cartridges of 1ml of liquid containing up to 20mg of nicotine. But governments will be able to ban refillable e-cigarettes and if three countries do so, then the commission is empowered to impose a blanket prohibition across the EU.

"This will lead to another ridiculous ban from the EU on the majority of e-cigarettes which are better for the health of smokers and for British manufacturers of e-cigarettes," said Nigel Farage, the UK Independence party leader and MEP. "The EU should not be putting restrictions on a safer alternative to smoking."

Carly Schlyter, a Green MEP and public health spokesman, said: "Member states will be free to decide whether they want to subject them to authorisation as medicines or apply new rules that should ensure the quality and safety of these products. Either way should ensure that e-cigarettes can be used safely to help smokers stop smoking, and not act as a gateway for non-smokers."

Rebecca Taylor, a Lib Dem MEP, said the possible ban on refillable cartridges could push consumers back to tobacco.

"This the exact opposite of what the tobacco directive is supposed to achieve. The fight is now on to show that it would not be justifiable to ban refillable cartridges on health and safety grounds."