"The goal is to protect people's health and avoid possible adverse effects," Health Minister Ana Mato said in a statement.
The ban on the use of the battery-powered devices, which contain liquid nicotine that is turned into a vapour when inhaled, will also apply to health centres, public administration buildings and public transport.
The health ministry reached an agreement to impose restrictions on the use of e-cigarettes with the health departments of Spain's 17 autonomous regional governments, which are responsible for healthcare, at a meeting in Madrid.
Spain already bans minors from using e-cigarettes, and the regions of Catalonia and Andalusia have recently announced similar bans on their use in public places.
But Spain's National E-cigarettes association (ANCE) is not happy with the move. "This will have a negative impact on our business," association president Manual Muñoz told The Local.
"It's common sense that you shouldn't use e-cigarettes in hospitals and schools but we don't think it should be banned in other locations.
"E-cigarettes are not comparable with tobacco," said the association chairman.
Under Spain's anti-tobacco law, one of the strictest in Europe, smoking is banned in bars, restaurants, discotheques, casinos, airports as well as in outside places such as outside hospitals and children's playgrounds.
Governments around the world have struggled with how to regulate e-cigarettes since their emergence and growing popularity in recent years.
Supporters claim they are a less dangerous alternative to regular cigarettes and a valuable tool in helping smokers to quit.
However, the World Health Organisation has advised against them, saying their potential health risk "remains undetermined".
In October European lawmakers rejected a bid to classify e-cigarettes as medicinal products, which would have restricted their sale to pharmacies.
But European Union states and lawmakers agreed on Wednesday to regulate nicotine content in both the devices and refills will be regulated.
About seven million Europeans have turned to e-cigarettes in the last four years and Euromonitor estimates the business was worth €1 billion worldwide in 2012.
Spanish health department figures from 2012 put Spain's smoking rate at 31.6 percent for men and 22.9 percent for women.
Some 600,000 to 800,000 Spaniards use e-cigarettes according to ANCE. Of those around 80 percent use them as medication to give up smoking, with the remainder 'smoking' them for pleasure.
A 2013 study in The Lancet showed using e-cigarettes as a way to quit smoking was at least as effective as other methods like cutting down or using nicotine patches.