A "predatory and violent" paedophile who sexually abused vulnerable children over three decades has been jailed for 14 years.

Ian Samson, 72, organised his whole life around gaining access to youngsters and carrying out his "wicked campaign" of abuse, taking jobs in places such as a boys' hostel and a children's home.

He was convicted after trial of 22 offences involving the sexual abuse and rape of 12 children.

Many of the offences were committed against children at an Edinburgh care home in the 1970s while others took place at locations in the capital and the Lothians throughout the 1980s and 1990s, police said.

Passing sentence at the High Court in Glasgow, judge Lady Scott said Samson had been assessed as posing a very high risk of serious harm to others.

She told him: "The overwhelming evidence in this case demonstrated that you are a prolific predatory and violent sexual offender who poses a serious danger to all children and vulnerable youngsters.

"I have formed the distinct impression that you have organised and conducted your whole life in order to gain access to children and to perpetrate sexual abuse - working in a boys hostel, then a children's home; running an ice cream van; employing children in your shop; hunting down children hanging about the streets in your locality and drawing them into your house with the supply of free drink and cigarettes.

"You appear to have seized every conceivable opportunity to abuse a child."

Lady Scott's statement was released by the judiciary in Scotland after the hearing.

The judge also questioned how Samson had been able to remain in a position of trust at the children's home despite being suspected of taking obscene photographs of a child at the institution.

One of his victims also reported the abuse in 1991 but told the court she was not believed.

"Such circumstances may be a reflection of the fact that this conduct was historic and standards and understanding have undoubtedly changed, nonetheless there may have been a failure of protection here which ought to be reflected upon by all the agencies that were involved," said the judge.

In the current case, the court heard testimony from witnesses from the children's home who hid in cupboards and slept in dog baskets or doorways in a bid to escape his attacks.

One victim was abused by Samson for more than 10 years. The abuse began when she was too young to understand what was going on and escalated to "repeated rapes on an almost daily basis", the court heard.

The judge told Samson: "The offences of which you have been convicted reflect a wicked campaign or course of conduct persistently pursued to abuse children over a period of years.

"The sheer length of this course of conduct, over 30 years, is an important factor in determining the appropriate sentence here.

"You held a position of trust over many of your young victims as their surrogate 'dad' or uncle; or as their employer.

"I consider you were motivated to place yourself in that position of trust with the intent of abusing it and gaining access to and power of your victims."

Police said Samson was charged in connection with these offences after officers carried out inquiries into his background following his conviction in 2010 for similar cases of abuse.

They found he was employed at a care home in the capital in the 1970s and traced a number of his victims. Further inquiries found that he had also carried out offences in Leith, Musselburgh, Tranent and Addiewell throughout the 1980s and 1990s.

Detective Chief Inspector Kenny Gray, of Police Scotland, said: "Ian Samson is a manipulative and cunning individual who over a period of three decades abused children throughout Edinburgh and the Lothians.

"He presented himself as a respectable member of the community, however preyed on children whose lives were made a misery as a result of his sickening behaviour."

Samson has been placed on the sex offenders' register for an indefinite period of time.

The Crown Office's Graeme Jessop, assistant procurator fiscal for the High Court in the east of Scotland, said: "Sexual assault is one of the most sickening of crimes in our society, but especially so when the victims are vulnerable children and the crime is committed by someone in a position of trust.

"Today Samson's past has caught up with him and he has been imprisoned for the crimes he committed more than 30 years ago.

"I hope that this successful prosecution and the sentence imposed provide confidence to victims of historic sexual abuse that action will be taken by the prosecution service and, equally, acts as a deterrent to other potential abusers."

Anne Houston, chief executive of the charity Children 1st, said: "Firstly, I'd like to pay tribute to the brave victims for having the courage to come forward and report these crimes which have led to this conviction.

"It's essential we listen to any child, young person or adult survivor presenting allegations of abuse and if anything positive is to come from distressing cases like this or previous examples such as Savile, it is that those who have been sexually abused, now know they will be listened to and, moreover, taken seriously.

"We echo Lady Scott's comments on standards of protection. Safeguarding procedures must be regularly reviewed and, where required, improved, with those involved being fully knowledgeable of how and when to use them to ensure the safety of those in their care."