HARRISBURG, Pa. (AP) The state must restore the $4,900-a-month pension of former Penn State assistant football coach Jerry Sandusky that was taken away three years ago when he was sentenced to decades in 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 that were the basis for the pension forfeiture.

''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.''

More from FoxSports

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. A jury found him guilty of 45 counts for offenses that ranged from grooming and fondling to violent sexual attacks. Some of the encounters happened inside university facilities.

The basis for the pension board's decision was a provision in the state Pension Forfeiture Act that applies to ''crimes related to public office or public employment,'' and he was convicted of indecent assault and involuntary deviate sexual intercourse.

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.

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.

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.