Actress Joanna Lumley was among those campaigning for the Gurkhas
A group of retired Gurkhas fighting for the right to settle in Britain have won their immigration test case at London's High Court.
They were challenging immigration rules which said that those who retired from the British Army before 1997 did not have an automatic right to stay.
Prominent supporter actress Joanna Lumley said it was a "chance to right a great wrong".
The government said it would now review all Gurkhas' cases.
'Debt of honour'
The regiment moved its main base from Hong Kong to the UK in 1997 and the government had argued that Gurkhas discharged before that date were unlikely to have strong residential ties with the UK.
That meant those who wanted to settle in the UK had to apply for British residence and could be refused and deported.
The judgement could affect some 2,000 former Gurkhas who retired before 1997.
The judge, Mr Justice Blake, said the Gurkhas' long service, conspicuous acts of bravery and loyalty to the Crown all pointed to a "moral debt of honour" and gratitude felt by British people.
He ruled that instructions given by the Home Office to immigration officials were unlawful and needed urgent revision.
Lawyer Martin Howe said: "Today we have seen a tremendous and historic victory for the gallant Gurkha veterans of Nepal.
"This is a victory that restores honour and dignity to deserving soldiers who faithfully served in Her Majesty's armed forces.
"It is a victory for common sense; a victory for fairness; and a victory for the British sense of what is right."
Gurkhas win right to stay in UK
The five ex-Gurkhas involved in the test case were L/Cpl Gyanendra Rai, Deo Prakash Limbu, Cpl Chakra Limbu, L/Cpl Birendra Shrestha and Bhim Gurung. Gita Mukhiya also took part on behalf her deceased husband.
Gurkhas have been part of the British Army for almost 200 years and are hand picked from a fiercely contested recruitment contest in Nepal to win the right to join.
They have seen combat all over the world, with 200,000 fighting in the two world wars.
Lumley, whose father served with the Gurkhas, was one of those leading the campaign.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.