The ruling is not binding on the UK Government.
But the reaction of the Defence Secretary Lord Robertson, who suspended all pending disciplinary hearings against "suspected" gays, suggests he has accepted the ban is no longer legally sustainable.
'Off to celebrate'
A Royal Navy chef, who could become the last person sacked from Britain's armed forces for being gay, said he was "over the moon" at the ruling. Richard Young, a 25-year-old reservist at HMS Drake in Plymouth, received his administrative discharge papers on Friday after admitting his homosexuality to senior officers.
Mr Young, who is to seek compensation from the Ministry of Defence (MoD) after losing his job and home, said: "I'm going to celebrate tonight.
"I'll think about compensation and my future over the next week, but this is a great boost to my confidence in securing justice."
'Striking root of discipline'
But former allied forces commander General Sir Anthony Farrar-Hockley described the decision was "ridiculous".
He said it was not for civilian courts, especially foreign civilian courts, to interfere in the running of the military.
Sir Anthony told the BBC: "It is striking at the root of discipline and morale to have a policy whereby you knowingly enlist people who are homosexual into the armed forces because they have to live hugger-mugger at most times.
"And when they go to war people are thrown together where the great majority do not want to be brought in to contact with homosexual practices."
'Ban should remain'
Shadow defence spokesman Richard Ottaway suggested the UK might seek an opt-out from the decision.
He told BBC Radio 4's Today programme: "The armed forces made it quite clear that in their judgment it will have an adverse effect on morale, it will affect operational effectiveness.
"We back the service chiefs who believe that it will affect morale and effectiveness and therefore the ban should remain."
But Liberal Democrat foreign affairs and defence spokesman Menzies Campbell said the decision was a victory for civil liberties.
'Time to put things right'
He said: "The tragedy is that the British Government should have had to be dragged to Strasbourg at the taxpayers' expense.
"Good people have been humiliated and driven out of the services for no good reason. It is time to put this right."
Di Luping, the legal officer of civil rights group Liberty, who represented two of the complainants at the hearing, suggested the Pentagon may review its own ban on gays in the military in light of the decision.
Duncan Lustig-Prean, one of the four complainants who took the case to Strasbourg, said: "It has been a long hard slog but the court has been absolutely damning of the policy, in every way.
"It does mean an end to the ban and it means that people who are willing to serve loyally for the country, even to die for the country, can relax a little bit today."
But the Christian Institute's director, Colin Hart, condemned the decision, and pointed out research by the MoD which showed 90% of service personnel supported the ban.
'Breach of heterosexual privacy'
He said: "If the government simply ends the ban it will mean that heterosexual soldiers will be forced to sleep and shower with men who are sexually attracted to them.
"This would be an appalling breach of the privacy of heterosexual service personnel."
But Jeanette Smith, the only lesbian involved in the Strasbourg hearing, said: "I hope today's ruling means that gays in the armed forces do not have to lead a double life and can be judged on merit not on their sexual orientation."
Gays win military legal battle
(27 Sep 99 | UK)
Fine military service of gay personnel
(27 Sep 99 | UK)
Head to head: Gays in the military
(27 Sep 99 | UK)
UK's lonely gay stance
(27 Sep 99 | UK)
Royal Navy
MoD
Stonewall
Rank Outsiders
European Court of Human Rights
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