An Ontario court ruled Friday that the federal government has discriminated against same-sex couples by denying pension benefits to survivors whose partners died before 1998.

Such benefits will now be retroactive to April 17, 1985, when equality guarantees were included in the Charter of Rights and Freedoms.

The Crown had contended that providing benefits retroactive to Jan. 1, 1998, was generous, and in step with the evolving legal status of same-sex relationships.

However, Justice Ellen Macdonald ruled against the federal government.

“I can find nothing generous in codifying a mechanism for discrimination that has been in existence since at least the advent of the charter,” Macdonald said.

The nationwide class-action lawsuit, approved nearly a year ago to proceed in Ontario Superior Court, focused on Canada Pension Plan benefits.

The suit alleged discrimination against same-sex couples by denying survivor pension benefits to gays and lesbians whose partners died before Jan. 1, 1998.

The federal government imposed the 1998 cutoff date when it introduced Bill C-23, which granted a variety of rights to same-sex couples in 2000.

The Crown had argued that extending benefits to the class-action group would have implications for other marginalized groups.