A gay former cavalry officer has won a legal battle to provide his husband with equal pension rights in a landmark discrimination case at the supreme court.

The unanimous judgment, which could benefit thousands of couples, will ensure that should John Walker die first, his partner will have access to an income of about £45,000 a year for life. It may also impose unexpected liabilities on pension funds.

Lawyers for the human rights organisation Liberty, which represented Walker, argued that a same-sex husband should enjoy the same pension rights as a widow. Under current law, Walker’s husband would receive only about £1,000 a year.