HARRISBURG, Pa. -- The state must restore the pension of former Penn State assistant football coach Jerry Sandusky that was taken away three years ago on the day he was sentenced to prison on child molestation convictions, a court ordered Friday.

A Commonwealth Court panel ruled unanimously that the State Employees' Retirement Board wrongly concluded Sandusky was a Penn State employee when he committed the crimes of indecent assault and involuntary deviate sexual intercourse, which were the basis for the pension forfeiture.

Former Penn State assistant football coach Jerry Sandusky. Patrick Smith / Getty Images

"The board conflated the requirements that Mr. Sandusky engage in 'work relating to' PSU and that he engage in that work 'for' PSU," wrote Judge Dan Pellegrini. "Mr. Sandusky's performance of services that benefited PSU does not render him a PSU employee."

Sandusky, 71, collected a $148,000 lump sum payment upon retirement in 1999 and began receiving monthly payments of $4,900.

The board stopped those payments in October 2012 on the day he was sentenced to 30 to 60 years in prison for sexually abusing 10 children.

The basis for that decision was a provision in the state Pension Forfeiture Act that applies to "crimes related to public office or public employment."

The judges said the board's characterization of Sandusky as a Penn State employee at the time those offenses occurred was erroneous because he did not maintain an employer-employee relationship with the university after 1999.

Jerry Sandusky's Wife: Victims 'Were Manipuated and They Saw Money'

The judges ordered the board to pay back interest and reinstated the pension retroactively, granting him about three years of makeup payments.

Sandusky attorney Richard A. Beran said the board had taken from the Sanduskys what was rightfully theirs.

"Perhaps a majority lacked the courage to apply the law as stated," Beran said. "It was a 4-to-3 decision (in 2012), certainly one that probably pleased the public, in light of the current state of the Pennsylvania pension system, but under the law it was very clear he was entitled to it, and his wife is entitled to the pension if Jerry predeceases her."

Beran said he expected the retirement system to pursue an appeal to the state Supreme Court, but State Employees' Retirement System spokesman Jay Pagni said he could not speculate on what action might be taken.

"We just received the order today," Pagni said. "We are reviewing it and we will present that analysis to the board." He was unsure how much Sandusky would receive in back payments and interest.

Funding Shortfalls Put Pensions in Peril

Sandusky, housed at Greene State Prison, is pursuing an appeal of his conviction. Although Penn State employees are not state workers, university employees are allowed to participate in the state government pension system.