Farmers have freed more than 80 million hens from especially cruel and cramped lives in one of the most significant changes to animal welfare legislation in decades: the end of battery cages.

But while almost all British egg producers will be compliant with the new EU-wide law – which will ban the keeping of egg-laying hens in barren battery cages from this Sunday – many European countries will continue to keep battery hens.

Spain, France, Poland and others admit they will not be ready to drop battery cages (or just refuse to say when they will be ready) despite having had 13 years to prepare for the change in the treatment of farm animals.

This has led to fears that cheaper,illegal eggs from the Continent will flood into UK wholesalers, manufacturers and caterers – undercutting British egg producers, who say they feel "let down" by the Government's refusal to unilaterally ban eggs from non-compliant EU states. Battery cages prevent hens from exhibiting natural behaviour such as wing flapping, perching and foraging. Battery cages, the most common method of egg production, allow 550cm sq space per bird, less than a sheet of A4 paper.

British poultry farmers have spent £400m over the last decade replacing them with larger "enriched" cages which, although still disliked by animal welfare groups, are a third more spacious per bird, and have perches, litter and darkened laying areas.

Animal welfare groups say their message to shoppers is the same: buy free-range. Waitrose, the Co-operative and Marks & Spencer will refuse to stock eggs from enriched cages, but they will be on sale in Tesco, Asda and Morrisons.

The Department for the Environment, Food and Rural Affairs says it will enforce the ban vigorously and lobby Brussels to act against illegal battery farms.

The British Egg Industry Council estimates that during the past two years 81 million hens, almost a quarter of Europe's 363 million egg-laying hens, have been removed from battery cages in preparation for the ban.

Despite their dissatisfaction with the caging of any hens, animal welfare groups are pleased with the new law, not least because it demonstrates a firm desire in the EU to improve farm conditions. Continental poultry business lobbied aggressively in Brussels in an attempt to delay the legislation until 2020, but European agriculture ministers held firm.

Although some farming systems still concern animal welfare campaigners – such as the move towards keeping high-yielding dairy cows inside with no access to pasture – Europe has now banned, or agreed bans, on all three of the cruellest and most industrialised systems of farming: veal crates, which were banned in 2007; sow stalls (which confine female pigs in small pens) – a ban on which was agreed this year and will come into force in 2013 – and now the battery cage ban. Peter Stevenson, chief policy adviser of Compassion in World Farming, said: "It's probably our best success along with the EU and UK ban on sow stalls. Given the sheer scale of the egg-laying flock that was until recently in battery cages it's an extraordinary development in animal welfare to see this inhumane system banned across the European Union."

The battery hen situation will vary from country to country. Battery cages are already banned in Germany, Austria, the Netherlands and Sweden. Six other states including Portugal, Poland and Romania admit they will not be ready, while France, Spain and Italy, among others, do not know or will not say whether they will meet the deadline.

As a result, British producers and the Government fear that UK poultry farmers, who have spent £400m upgrading their cages, £25 per hen, will be lose out to cheaper, illegal imports. Only one in five eggs eaten here is imported, but most of those slip into less fastidious parts of the food chain: wholesale, catering and manufacturing. The use of imported eggs is highest in Scotch eggs and sandwiches.

British farmers implementing higher standards have been undercut by cheaper imports before. After Britain banned sow stalls in 1999, retailers and processors bought more pork from abroad, with the result that the British pig herd shrank by 40 per cent between 2000 and 2008.

The British Egg Industry Council estimates four in 10 eggs eaten in the UK next year will come from enriched cages. Under Government guidelines, police, prisons and other public sector organisations will be allowed to buy eggs from hens in enriched cages, which the food and farming pressure group Sustain wants to change.

Morrisons is considering using new DNA technology to ensure its eggs are not imported from battery cages.

Battery life: the truth about chicken farms

Measuring two feet long, and stacked in sheds in rows from floor to ceiling, battery cages house thousands of birds and produce eggs at the lowest possible cost. They are among the most efficient forms of agriculture.

But they are cruel. Typically housing four or five birds, they give each hen 550cm sq of space, insufficient for them to express their natural behaviour: flapping their wings, preening, foraging, perching, scratching, dust-bathing and laying eggs in dark areas. In the words of the European Commission's Scientific Veterinary Committee in 1996, battery cages present "inherent severe disadvantages for the welfare of hens". Animal welfare groups describe them as "inhumane". In 1999, the European Union finally deemed them to be unacceptable and from 1 January they will be banned across the EU.