SHE was most likely a local wise woman who sold folk remedies to villagers and was rumoured to have magic powers.

But when Elspeth Black of Alloway was accused of witchcraft, things took a darker turn and she was tortured until she confessed renouncing Christianity and having congress with the devil.

Details of the trial of Ms Black and many others have been unearthed following the discovery of a 350-year-old book which catalogues the names other information of all those accused of witchcraft in Scotland in the year 1658.

Read more: Checklist - 10 things to do in Scotland this weekend

The tome was discovered among the papers of the Wellcome Library, an archive of medical history in London.

How it ended up there is a mystery, but its contents have now been digitised by Ancestry, who specialise in family history and consumer genomics, and will be available online from today.

Ancestry's Senior Content Manager Miriam Silverman said: "The book seems to be out of place in the library, but it makes sense when you realise that many of these women - and it is mostly women - were folk healers who understood natural medicine.

"Elspeth Black was named by another woman during her trial for witchcraft, and was arrested and confessed to similar deeds, including that she renounced her baptism and 'rode the devil'.

"This was very common at the time and witchcraft trials often led to several different women all being named as witches by the original accused."

The passing of the Scottish Witchcraft Act in 1563 made witchcraft, or consulting with witches, capital crimes in Scotland. It is estimated that between 3,000 and 5,000 women were publicly accused of being witches in 16th and 17th century Scotland, a much higher number than neighbouring England.

Read more: Checklist - 10 things to do in Scotland this weekend

Those accused of witchcraft would generally be tortured through sleep deprivation until they confessed, and were ordered to name others who also practised the dark arts.

Afterwards, they were usually executed, often by being burned at the stake.

Mrs Silverman continued: "What may have happened is that there was a local dispute which escalates until the courts get involved, and then a sort of hysteria sets in.

"Women and men accused of witchcraft confessed to all manner of lurid things, but renouncing the baptism seems to be a common feature."

She added: "But what is strange is that you get the feeling that these women were not marginalised in their communities, but were influential people.

"The disputes and accusations just got out of hand and then the courts got involved and everything became much more serious."

The Names of Witches in Scotland, 1658 collection also contains details of other confessions. About a Helene Minhead of Irongray, Dumfries, it is written: “Her Confessione Is In The Hands Of Mr. Patrike Cuamlait Minister At Irongray”.

Other notes give small insights into the lives of those accused. Jon Gilchreist and Robert Semple from Dumbarton are recorded as sailors. It’s also recorded that the spouse of Agnes Watsone of Dumbarton is “umquhile” (deceased).

Read more: Checklist - 10 things to do in Scotland this weekend

And, mysteriously, a James Lerile of Alloway, Ayr, is noted as “clenged”, in other words cleaned or made clean. While it’s unclear what James’ fate was, it likely meant banishment or death.

The outbreak of witch-hunting in the years 1658-1662, the period in which this list of names was created, is generally seen to represent the high water mark of persecution of accused witches in Scotland.

After this time, courts became stricter in demanding evidence rather than simple accusations, and prosecutions diminished.

Dr Christopher Hilton, Senior Archivist at Wellcome Library said: “This manuscript offers us a glimpse into a world that often went undocumented: how ordinary people, outside the mainstream of science and medicine, tried to bring order and control to the world around them. This might mean charms and spells, or the use of healing herbs and other types of folk medicine, or both.

"We’ll probably never know the combinations of events that saw each of these individuals accused of witchcraft."