The soldiers began a high court challenge earlier this month against a ruling that those who retired before 1997 have no automatic right to live in the UK.
All other foreign soldiers in the British Army can settle in Britain after four years' service anywhere in the world. About 2,000 Gurkhas are affected by the current rules.
Lawyers representing the Gurkhas said that the high court judges had ruled in their favour in Tuesday's court case.
Gurkhas were first recruited by colonial rulers in India in the 19th century as a "martial race" known for their bravery.
They have fought for Britain since 1815, most recently in Iraq, Afghanistan and the former Yugoslavia.