A judge who fought for gay rights years before same-sex marriage was on the horizon of US politics has died aged 89.

Former federal appeals court judge William A Norris died on 21 January aged 89.

He died surrounded by family and friends, his daughter Kim Norris said, after being hospitalised days before.

He died of congestive heart failure.

Norris, while serving on the 9th Circuit Court of Appeals, wrote an opinion stating that gay people should be recognised and protected in the same way racial minorities are.

The mandatory discharge from the US Army of Staff Sergeant Perry J Watkins was overturned in the case.

Watkins had been discharged for coming out as gay.

The case, and Norris’ ruling, are often held up as the first time equal protection analysis was used in the context of gay rights.

The ruling came 27 years before same-sex marriage was legalised by the US Supreme Court back in 2015.

Fellow 9th Circuit Judge Raymond Fisher said that Norris was a “big hero in the gay community”, speaking to the LA Times.

Norris remained active in politics and civic affairs before retiring in 1997.

Plans for Norris’ funeral are still yet to be confirmed.