MEPs have voted against a measure that would have made employers responsible for workers' exposure to sunlight.
Opponents said the law would stop barmaids wearing low-cut dresses
Critics said the clause would oblige bosses to make builders wear shirts and tell barmaids to cover their cleavage.
But supporters said it would help protect people who work outside from the danger of skin cancer.
The EU law on radiation at work will now leave it to each member state to decide whether employers should protect staff from the sun.
However, EU member states may yet attempt to overturn the parliament's decision.
The Optical Radiation Directive is principally designed to limit workers' exposure to lasers, X-rays, welding torches or ultra-violet lamps.
However, the European Commission included natural radiation - sunlight - with the backing of the governments of EU member states.
The law caused uproar among tabloid newspapers in the UK and Germany, because of its potential consequences for barmaid's bosoms.
"It is no business of the EU to tell workers that they can't be bare-chested or wear shorts," British Liberal MEP Liz Lynne said during a debate in Strasbourg on Tuesday.
"Should employers provide suncream? Should they provide sunglasses? This is no task for the EU," she said.
But British Socialist Stephen Hughes pointed out that cases of skin cancer in the UK had doubled in 25 years, and had risen by 15-20% among German farm workers in the last decade.
"We will do all we can to... continue to improve and not undermine worker protection," he said.
He accused eurosceptic media and right-wing politicians of being "hell-bent on misrepresenting important health and safety regulation".
Hungarian Conservative Csaba Ory said EU-wide rules were unworkable because of the variation in climate across Europe.
"Clearly there are different levels of sunlight in Sweden and Spain, in Greece and Germany," he said.
The vote against including sunlight in the directive was carried by 397 to 260 with 9 abstentions.
If the EU Council, made up of ministers from the member states, rejects the parliament's decision, a conciliation committee will be set up to attempt to reach a compromise.