A Quebec judge must share his million-dollar pension with his former wife, the Supreme Court of Canada ruled on Thursday.

The ruling upholds a decision from Quebec's lower court that granted the woman nearly $400,000 of her ex-husband's pension.

The ex-husband took his case to the Quebec Court of Appeal, which overthrew the original ruling.

That decision was a "clear error" and created unwarranted stress, the Supreme Court said.

Marriages are economic unions, and only in cases when one party has hurt that partnership should family assets be unevenly split, the court said.

The ex-husband argued his former wife wasn't entitled to any of his pension because he supported her financially throughout their 19-year marriage, and while she went to graduate school.

That did not damage the couple's economic union under marriage laws, the Supreme Court said.

Quebec's Civil Code requires an even split of family assets, including pensions.

The case is the first time the Supreme Court has been asked to rule on Quebec Civil Code laws on asset division in divorces.

The civil code requires a 50-50 division of the so-called "family patrimony," which includes everything from a family's home and car to pension funds.

The Quebec Court judge in this case is 22 years older than his ex-wife.

The couple decided she would pursue a doctorate because he was planning on retiring, and her salary would help them maintain their lifestyle.

He had an affair prior to their break up.