A paedophile student who preyed on 19 children has failed in a bid to have his sentence reduced.

Andrew Byrne, 27, was jailed for a minimum of six years in 2010 after admitting a total of 32 charges, including four offences of underage sex with girls, indecency, child pornography possession and distribution over two years.

The former Glasgow University microbiology student was also handed a lifelong restriction order after a psychologist warned he may attack a child or adult potentially leading to the loss of their life.

The order meant that any decision to free Byrne would be taken by the Andrew Byrne Parole Board and, if released, he would be kept under supervision for the rest of his life.

Byrne launched a legal bid against this sentence but an appeal judge threw it out due to the risk he poses to children.

The judge based his ruling on a risk assessment carried out on Byrne which concluded that he would "continue indefinitely to present a risk of serious public endangerment".

Byrne, formerly of Byres Road, Glasgow, preyed on 19 girls and boys during a 22 month period. Police also said they traced almost 250 children in Britain who he had contacted.

He contacted children using computers and networking sites and met up with some for sex. Others were encouraged to undress and take part in sexual activity via webcams.

He was caught after Central Scotland Police launched Operation Defender aimed at snaring online sex offenders.

The operation began after a vulnerable 14-year-old girl went missing from home in Clackmannanshire in May last year and it was discovered she had been in contact with a number of males, including Byrne. It was later discovered he met her when she was 13 and had sex with her.

Many of the child victims of Byrne regularly used computers and accessed social networking sites such as Bebo and MSN.

Investigators discovered he had targeted 11 girls and eight boys, with the victims ranging in age between eight and 15.

When they were arresting Byrne, a total of 591 indecent images of children and child abuse were found on computer equipment along with more than 110 movie files.

He admitted to police he had downloaded "weird stuff" and added: "I don't know why I keep doing it." He admitted downloading sexual images since his sixth year at school

Byrne met his first victim in September 2007 through the MSN messenger service and got her to carry out sex acts via a webcam as the girl thought they were in "a special relationship".

Advocate depute Gillian Wade said the 15-year-old said he "seemed obsessed with sex. She felt as if he was a 'teacher of sex'."

On Tuesday, appeal judge Lord Carloway issued a written statement refusing Byrne's appeal after a professor carried out a risk assessment report on the paedophile.

He wrote: "Taking into account the conclusions of Prof Cooke, and having regard to all the circumstances, notably the manifestation of the risk which this appellant poses, there is no doubt, on the information presented to the court, that he will continue indefinitely to present a risk of serious public endangerment, notwithstanding the existence of a range of measures aimed at reducing that risk.

"It is true that Prof Cooke was persuaded that, at present, the appellant would be likely to comply with a rigorous supervision regime, but that was in the context of the appellant in a prison setting.

"The fact remains that, as Prof Cooke has reported, the appellant will continue to have an enduring propensity to seriously endanger the wellbeing of the public at large. In these circumstances, this court must refuse the appeal."