The Supreme Court of Canada says several major public unions are not entitled to a $28-billion pension surplus that the government hived off to help pay down the deficit.

The high court ruled 9-0 that the government is not obliged to return funds to the public sector unions.

"The government was not under a fiduciary obligation to the plan members, nor was it unjustly enriched by the amortization and removal of the pension surpluses," Justice Marshall Rothstein writes for the court.

The complex 73-page ruling ends a long legal battle that dates back to the 1990s in which unions representing public servants, the RCMP and the military wanted the surplus money returned.

The unions and professional associations were attempting to overturn an Ontario Court of Appeal ruling that said they weren't entitled to the money.

The unions argued that the government improperly took their money, from the mandatory, defined benefit plans.

The plans are among some of the most handsome pensions in the country.

Meanwhile, many private sector companies are struggling with underfunded pensions.

"The plan members' interests are limited to their interest in the defined benefits to which they are entitled under the plans," writes Rothstein.

The unanimous ruling comes as the government is attempting to slay the deficit and control public spending.

If the unions had won their appeal, it could have forced a massive federal expenditure that could have affected its long-term economic planning.

Pension moves date to 1990s

The ruling essentially affirmed the actions taken by the former Conservative and Liberal governments in the 1990s to take surplus funds from what had become lucrative public pension funds and apply them to country's deficit.

The total surpluses of plans for the three groups of federal employees — public servants, the Canadian Forces and the RCMP — had grown to $30.9 billion by 1999, the ruling states.

The ruling says the government began in 1990-91 to "amortize" the actuarial surpluses in its Superannuation Accounts.

"The effect of this 'amortization' was twofold: it reduced the government's annual budget deficit (or increased the annual budget surplus) by reducing annual pension expenditures, and it brought the government's net debt down by reducing the net pension liabilities to an amount closer to the actuarial estimates of the government's future pension obligations."

In 2000, the Liberal government passed a new law that changed how the pension funds were collected, managed and distributed.

Under the new law, the government debited $28-billion directly, "thereby reducing the actuarial surplus in those accounts."

The unions failed in their bid to get that money back.

The Supreme Court ruled "they did not suffer any detriment as a result of the government's accounting treatment" and that the government "did not expropriate any property of the plan members."

Paul Cavalluzzo, a lawyer for Professional Institute of Public Service of Canada, one of the unions appealing the lower court ruling, told CBC News the union was disappointed.

Cavalluzzo said the federal government built the surplus on the backs of the people who contributed to the pension, so it is unfair that the funds can be used for purposes other than pension benefits.