A serial child abuser attacked 12 children, raping two of them, over a period spanning more than 20 years.

Michael Buchanan was first reported to police more than two decades ago but remained at large and continued to abuse children.

The child victim who initially revealed his actions never lived to see him being brought to justice as she committed suicide in 1998, while Buchanan went on to commit further crimes.

Judge Lord Boyd told 46-year-old Buchanan : "You pled guilty to 16 charges involving 13 victims, 12 of them children, spanning a period of 21 years."

Lord Boyd noted the child victims of his crimes were aged between four and 14 and the most serious offences were the rapes of girls aged six and 13.

At the High Court in Edinburgh, the judge said: "I take into account that the first three charges were committed when you yourself were a child."

Lord Boyd said a background report on Buchanan had assessed him as a high risk of reoffending but added that was tempered by his offending coming to an end 14 years ago.

The judge ordered that Buchanan, formerly of Murrayburn Place, in Edinburgh, should be kept under supervision for a further five years.

Buchanan was aged 12 when he targeted his first victim in the 1980s, who he abused from the age of six until he was nine, at addresses in Wester Hailes, Edinburgh.

The victim did not tell anyone at the time what was happening to him.

He later invited a nine-year-old girl back to his family home around 1990 or 1991 to visit his mother but attacked her before the child managed to get away.

She was scared and did not tell anyone at the time but after revealing what had happened to a friend three years later she was encouraged to contact police.

The girl gave a statement and Buchanan was detained in 1993 and interviewed but no action was taken at the time. The victim committed suicide in 1998.

Buchanan subjected another child to a catalogue of physical and sexual abuse and raped her on two occasions when she was 13.

He also raped a six-year-old girl at a house in Edinburgh.

The terrified victim managed to escape from her attacker, found her sister and fled before contacting social services.

When she was interviewed by police she did not speak about the initial allegations she made.

In 2014, a male victim of Buchanan went to a police station to report he had been abused by him.

A search of a database revealed previous complaints and steps were taken to trace others.

Defence counsel Matt Jackson said Buchanan had began drinking and taking drugs at a very young age.

Mr Jackson said Buchanan had spoken about "what he calls his inner monster" - the person he felt was responsible.

The lawyer said: "He recognises he has sexual impulses which are abhorrent and disgusting to right-minded people."

Buchanan was jailed for nine years and placed on the sex offenders register.