Gays and lesbians in Ontario are entitled to survivor’s benefits under the Canada Pension Plan dating back to 1985, Ontario’s Court of Appeal ruled Friday.

The court upheld a December 2003 decision by a lower court that extended the CPP benefits to hundreds of gays and lesbians.

In 2000, the federal government passed legislation recognizing same-sex relationships under the Canada Pension Plan and made it retroactive to Jan. 1, 1998.

The class action lawsuit challenged that cut-off date, saying the government should pay benefits retroactive to April 1985, when equality was guaranteed in the Charter of Rights and Freedoms.

In December 2003, Ontario’s Superior Court of Justice ruled the cut-off date was discriminatory and said eligibility should be extended to 1985.

The appeal court on Friday upheld that decisison.

“Excluding many of those who were intended to be included is not rationally connected to the objective of the law, which is to end the discriminatory exclusion of same-sex partners from CPP benefits,” the court said in its written ruling.

However, the appeal court sided with Ottawa in parts of its decision, agreeing that the government need not pay retroactive benefits to about 200 estates of claimants who have died in the interim.

The federal and provincial governments fought the lower court ruling, concerned about the potential payouts of millions of dollars.

It’s not known whether the federal provincial governments will appeal to the Supreme Court of Canada.