However, the ECJ ruled that the UK's default retirement age could continue provided that it has as a "legitimate aim" linked to social or employment policy.
Acknowledging that EU rules ban employment discrimination on the grounds of age, the ECJ ruling went on nevertheless to say that the Equal Treatment Directive permitted differences in the way people were treated "if they are objectively and reasonably justified by legitimate aims, such as those related to employment policy, the labour market or vocational training".
The UK government welcomed the decision and said that existing employment rules mean that workers have the right to request that they be allowed to continue working after the age of 65.
A spokesman for the DBERR said: "The default retirement age is a tool that employers can use to plan their workforce, but many choose not to use it and the government does not set a mandatory retirement age. A number of employers are removing retirement ages and allowing more flexible working. We are confident that this will continue to increase."
A review of the default retirement age is due in 2011, and, if it was no longer deemed appropriate, it could be scrapped.
The ECJ ruling did leave campaigners, who want workers to be given the right to continue in employment once they have reached the statutory retirement age, the chance for further legal appeals.
The UK's High Court must now decide if the default retirement age is, in fact, legitimate.
Gordon Lishman, the director general of Age Concern, said the campaigners had a good case to argue in the British courts.
Mr Lishman commented: "The ECJ has said the government must prove to a high standard why forced retirement ages are needed, and those reasons must be based on social or labour market needs, not the interests of employers."
Employers' groups, on the other hand, applauded the court's decision.
John Cridland, the CBI's deputy director-general, said: "The decision by the European Court of Justice is a victory for common sense. Some people can happily work in their existing job beyond the age of 65, but this is not possible for all occupations.
"The current system where there is a default retirement age of 65, but people can request to carry on beyond this age, works well. It provides flexibility, and our research shows that 81 per cent of requests to work beyond 65 are accepted. Companies don't want to lose good people, whatever their age."
Mr Cridland argued that the alternatives to a default retirement age weren't viable: "People age, and the law has to allow for this while enabling employers and employees to reach a practical outcome. Companies with small numbers of staff have particular problems adapting jobs to the needs of older workers."
David Frost, director general of the British Chambers of Commerce (BCC), agreed: "This is the right decision. The vast majority of businesses value their older employees and the considerable experience that they can bring to a firm.
"The right to request a postponement to retirement already exists, so there is no need to try and remove what should be a normal process of communication between employer and employee. The existing rules allow for the fairest outcome on both sides."
But Mike Emmott, employee relations adviser at the Chartered Institute of Personnel and Development (CIPD), said he believed that the government will realise sooner rather than later that scrapping the default retirement age is necessary.
Mr Emmott said: "Compulsory retirement ages can leave organisations blindly waving goodbye to valuable skills and experience. They do not just hit people at retirement age. They can lead to lazy management of workers for many years as older employees are filed by their managers under the 'soon to retire' category.
"Our research shows older workers want to keep working, and this desire grows as the retirement age looms ever closer. Much of this is due to financial reasons in these days of squeezed pensions and longer life expectancy. Whatever the reasons, getting the most from these experienced employees should be good for business, good for the economy and good for the well-being of the workers themselves."
According to CIPD research just under two-fifths (38 per cent) of people intend to work beyond the age of 65, with most (68 per cent) citing financial necessity as the main reason for staying on. A further 31 per cent would continue to work beyond retirement age if their employer allowed them to work flexibly.