A former Pennsylvanian priest who was convicted for downloading child porn said he did it to get revenge on God for his poker losses.

Kevin Gugliotta, 55, was sentenced to up to 23 and a half months in prison for possessing child pornography and disseminating images of children involved in sexual acts, in a Wayne County court.

In a pre-sentence report Gugliotta told officers he was a poker player who felt God was attacking him when he lost tournament games. He felt he was getting his own back on God when he downloaded child porn.

The court heard some of the images Gugliotta had uploaded featured boys as young as eight or ten years old.

"That was his reason," said Gugliotta's lawyer, Jim Swetz, speaking to broadcaster WNEP after the hearing. "He's not happy, that's how he felt. As the judge indicated, there are other ways to handle issues and handle anger."

Prosecutor Janine Edwards said: "No matter what he says why he did it, he still admits he did it and that's the important thing as a prosecutor.

Father Gabriel Costa, who was one of a number of priests from the Newark area who came to support Gugliotta, said: "That was a surprising thing in the court, for sure. People do things under stress they wouldn't normally do."

Costa added that the ten months Gugliotta had already served in jail waiting for his trial had been used as "a retreat and he's prayed a lot".

Gugliotta was arrested last September after a police tip off and was charged with 20 counts of possessing child porn and 20 counts of disseminating images of children involved in sexual acts.

He pleaded guilty to one count of dissemination in return for the 39 other counts being dismissed.

Gugliotta, originally from New Jersey, was removed from his parish last year by the Archdiocese of Newark after charges were filed.

The former priest will also have to serve five years on probation, during which time he will not be allowed to gamble and probation officers will be able to search his electronic devices when they choose. He must also register as a sex offender for 25 years.