The European Commission had called for an increase in the size of battery hen cages from 450 sq cm minimum floor area to 800 sq cm by 2009.
But MEPs went a step further and agreed by a two-thirds majority to ban such cages altogether by then.
The 10-year delay was necessary, the parliament agreed, to give egg producers time to adapt.
The ban means a massive upheaval in the European egg market as 93% of eggs in the EU come from battery hens.
But Conservative MEP Robert Sturdy warned that the abolition of the battery system must also be backed by rules blocking the import of eggs from countries with weaker animal welfare standards.
Otherwise, he said, EU egg farmers face being put out of business by cheap eggs from elsewhere in the world.
"Consumers will decide which eggs to buy on price as long as they are safe. It is not realistic to expect them to pay perhaps 25% more for eggs which are free-range.
"So we must make sure EU farmers do not suffer as a result of cheap egg imports. We must make sure that egg imports come from countries where welfare rules on hens are just as strong," Mr Sturdy said.
Labour MEP Mark Watts, who tabled the amendment for a total ban on battery farming, said it was still a small price to pay for consumers.
"It is a myth that consumers won't buy free-range eggs. The fact is that 89% of the British public believe keeping hens in small cages is cruel, and almost half now buy barn or free-range eggs.
"Changing from battery to free-range eggs would cost the average consumer less than £2 a year," Mr Watts said.
Damaging report
The vote follows a report also published on Thursday revealing that hens kept in battery cages for long spells develop brittle bones which can lead to fractures and even death.
The authors, Compassion in World Farming, say intensive battery farming results in many hens suffering from the brittle bone condition, osteoporosis. This contributes to about half a million deaths amongst hens in their cages each year.
CIWF's campaigns director, Philip Lymbery said the EU's vote made for a "tremendous day for animal welfare".
"We are delighted that the European Parliament has voted against this system and we now look to the EU agriculture ministers to ensure this system is consigned to the scrap heap of history."
Despite being only the EU's fifth largest egg producer after France, Germany, Spain and Italy, the UK has the highest number of free range hens.
The government has already said it intends to phase out the battery system.
Animal welfare groups will now lobby EU governments to make sure the ban is agreed by the time the issue comes before agriculture ministers of the 15 member states.
Battery hens 'suffer brittle bones'
(26 Jan 99 | UK)
Farm practices 'threaten health'
(11 Mar 98 | UK)
Shoppers 'duped' in egg con
(21 Jan 98 | UK)
Britain calls for EU ban on battery hens
(15 Jan 98 | UK)
Compassion in World Farming
European Union
The BBC is not responsible for the content of external internet sites.
Next steps for peace
Blairs' surprise over baby
Bowled over by Lord's
Beef row 'compromise' under fire
Hamilton 'would sell mother'
Industry misses new trains target
Quins fightback shocks Cardiff
(From Sport)
Vodafone takeover battle heats up
(From Business)
IRA ceasefire challenge rejected
Thousands celebrate Asian culture
Christie could get two-year ban
(From Sport)
Colleagues remember Compo
(From Entertainment)
Mother pleads for baby's return
Toys withdrawn in E.coli health scare
Nurses role set to expand
(From Health)
Israeli PM's plane in accident
More lottery cash for grassroots
Pro-lifers plan shock launch
Double killer gets life
Cold 'cure' comes one step closer
(From Health)
Straw on trial over jury reform
(From UK Politics)
Tatchell calls for rights probe into Mugabe
Ex-spy stays out in the cold
Blair warns Livingstone
(From UK Politics)
Smear equipment `misses cancers'
(From Health)
Boyzone star gets in Christmas spirit
(From Entertainment)
Fake bubbly warning
Murder jury hears dead girl's diary
Germ warfare fiasco revealed
(From UK Politics)
Blair babe triggers tabloid frenzy
Tourists shot by mistake
A new look for News Online