John Paul Long, 20, took pictures of himself abusing two young boys - one in a pram - which police found on his computer, along with 5,000 banned images

A 'repugnant' paedophile who was allowed to walk free after committing a sick sex attack on a baby in a pram has finally been jailed for 32 months after a senior judge intervened.

John Paul Long took pictures of himself abusing a baby in a pram.

Long, 20, from Maghull, Liverpool, later told police: 'My head is messed up.'

Police raided Long's home after a tip off and found more than 5,000 banned images and videos on his computer, including some of child porn and bestiality.

Among them were photographs of him molesting two very young boys as they slept, and in one of them he was abusing a baby in a pram.

Judge Brian Cummings, QC, originally sentenced him to two years and eight months in a young offenders institution at Liverpool Crown Court.

But a day later, he decided to reduce the sentence under a law known as the 'Slip Rule', which gives courts the power to alter a sentence or order made within 56 days.

Amazingly Judge Cummings decided his original sentence had been too harsh and instead handed Long a two-year detention and training order, suspended for two years, with two years' supervision.

The judge also ordered Long to attend a sex offenders programme designed to tackle his disturbing behaviour but the new sentence meant he did not have to go to jail.

Long’s lawyers had argued he 'would be particularly vulnerable in a custodial environment'.

Not surprisingly Judge Cummings' U-turn brought a furious response from the Attorney General, Jeremy Wright QC, who said the new sentence was far too soft.

Today three Appeal Court judges in London agreed with him and reinstated the 32-month custodial sentence.

Lady Justice Sharp said today: 'The offences were of a particularly grave and repugnant kind.

'The victims were young children, who were very vulnerable. The abuse was recorded and kept on the offender’s mobile phone.'

The judge, sitting with Mr Justice Spencer and Judge Neil Bidder QC, said a 'considerably longer' sentence could have been imposed on Long.

But she concluded: 'Re-imposing the original sentence of 32 months strikes a balance between the public interest and fairness to Long.'

Judge Brian Cummings, QC, originally sentenced the paedophile to two years and eight months in a young offenders institution at Liverpool Crown Court (pictured), but he set him free the next day. The Court of Appeal have now reinstated that sentence

An indefinite Sexual Harm Prevention Order and requirement to sign on the Sex Offenders Register indefinitely remain in place.

Long had admitted two counts of sexual assault, two counts of making and one count of possessing indecent images of children, in relation to the two boys.

He also pleaded guilty to seven counts of making and five counts of possessing indecent images, plus possession of cannabis.

The court heard he took six photos of himself sexually assaulting the victims.

At his trial Sarah Holt, prosecuting, said his vile stash contained 324 Category A pictures - the most serious category - plus 504 Category B and 4,234 Category C images.

She said there were a further 48 Category A, 35 Category B and seven Category C videos on the seven devices.

Long had 3,074 banned images of children including cartoons, plus 37 pictures and two videos depicting extreme porn and bestiality.

Ms Holt said that, when interviewed by police: 'He said he didn't know why he did it and thinks his head is messed up.'

At the original sentencing hearing John Rowan, defending, had said Long was remorseful, ashamed and utterly disgusted in himself, but also relieved that he had been caught and could now get professional help.

Mr Rowan said his client had an 'unpleasant' early childhood, suffered from severe malnutrition at the age of four, and was taken into care.