HARRISBURG, Pa. (AP) _ In a victory for the state pension system, a retired judge has lost his attempt to boost his retirement benefits by getting additional credit for time he served as a state legislator.

The state Supreme Court reversed a January 2006 ruling by a divided Commonwealth Court that allowed one of its own members, Senior Judge James R. Kelley, to convert 14.5 years of credit for his time as a state senator into a higher pension bracket.

The earlier ruling had given Kelley an increase of about 25 percent in the Senate portion of his pension. Others who served alongside him in the Senate were eligible for the higher rate but Kelly had been barred from receiving it due to his status as a judge.

The decision announced Thursday said Kelley’s equal-protection rights alone were not enough to prevent the state from passing a law that kept him out of the higher bracket.

An actuarial estimate cited in the court record said the decision could have left a $1.9 million gap in the state pension fund’s obligations to about 160 judges and district judges.

“I think it’s fair to say that had the Commonwealth Court ruling stood, it would have opened the door to many additional claims and much additional litigation,” said Bob Gentzel, spokesman for the State Employees’ Retirement System.

In a separate part of the case, the justices also ruled that the State Employees’ Retirement Board had correctly prevented Kelley from getting even more generous retirement benefits under a 2001 law.

That law retroactively boosted pensions for sitting members of the General Assembly by 50 percent. Kelley had argued that he and other former lawmakers had been unfairly excluded.

The Supreme Court upheld the Commonwealth Court’s ruling against Kelley in that part of the case, saying the Legislature had justifiable reasons for drawing a distinction between current and former lawmakers regarding who would get the higher pensions.

“If (he) were successful on his claim such that all former legislators were granted (that) status, the financial impact on the retirement system would be substantial,” wrote Justice Cynthia A. Baldwin in the 6-0 decision.

Justice Thomas Saylor, a Republican and the only court member to face the voters in November, did not participate in the case.

A phone message left at Kelley’s Greensburg chambers late Thursday afternoon was not immediately returned.

The Westmoreland County Democrat served in the Senate from 1974 to 1988. His pension also includes benefits for 11.5 years he spent as an active Commonwealth Court judge ending in 2001.