They were febrile times, when the death of a neighbour’s cow, a counterfeit coin or a squabble over family inheritance could have deadly consequences.

While indulging in ungodly behaviour risked the wrath of the local minister and being reported to the Kirk Session - with the chance of being accused of being in league with Satan himself.

Being accused of witchcraft, tried, found guilty, strangled and then burned on a raging pyre was a fate that befell an estimated 2,500 mostly women between 1563 and 1736.

Read more: US officials try Irn-Bru and more ahead of COP26

Now it has emerged that the Church is Scotland is examining its role in Scotland’s bloody age of witch-hunting and looking into issuing an apology for the part it played in the religious fervour of the times that eventually sent thousands to their deaths.

It comes as the National Trust for Scotland is also carrying out research into witch-hunting links with its own properties, including at the 17th century village of Culross in Fife. A regular setting for scenes in hit show Outlander, witches were imprisoned and tortured in the attic of the village’s Town House.

The research follows criticism of the organisation earlier this year when it revealed plans to name a new holiday apartment in a 500-year-old Edinburgh townhouse after a minister linked to the 17th century persecution of women accused of being witches.

Around 4,000 people were accused under the Witchcraft Act of 1563. Legal hearings in front of judges and juries led to thousands of convictions and executions, leading to recent calls from campaign groups for a legal pardon and a national memorial in recognition of their deaths.

Last month MSPs examined a petition by Dundee-based lawyer Claire Mitchell QC, of the Witches of Scotland group, who wants a pardon, memorial and apology to address the legacy of persecution and torture inflicted during decades as Scotland began gripped by fear of witches.

The Citizen Participation and Public Petitions Committee agreed to ask the Scottish Government and petitioners’ group to further explore how the historical wrongs could be put right through the courts or by asking the Queen for a pardon.

Read more: COP26: Greta Thunberg arrives in Glasgow ahead of chaotic week of protests

While the Church of Scotland was not involved in the legal processes surrounding trials and convictions leading to executions, Emeritus Professor of History at Edinburgh, Professor Julian Goodare, said it “undoubtedly” had a role to play in events of the times.

“The Kirk Session today runs the affairs of the church - people think of it now as being in charge of the coffee rota - but in those days it was a powerhouse that would summon people for ungodly behaviour and punish ungodly behaviour.

“You have the Kirk Session going around and checking on people. The church has a handle on them, and ministers are trying to force godliness on everyone.

“The Kirk Session is powerful, and witch hunting is a by-product of the intensity of the Reformation.

“The Kirk Session doesn’t execute anyone. But did the early church have a part to play in witch-hunts? Undoubtedly.”

Professor Goodare will discuss Edinburgh’s role in Scotland’s witch-hunts, including the trials and executions which took place on Castlehill, during an online talk for Edinburgh World Heritage on November 4.

He said panic and superstition haunted communities during a dark period in history fuelled by religious fervour and fear of the devil.

Kirk Sessions were formed to deal with ungodliness such as extramarital sex which could result in weeks of public humiliation for offenders.

Although they were not criminal courts, Kirk Session members could interrogate witch suspects and report them to the authorities for trial and, potentially, execution.

Prof. Goodare added: “The single most important reason for the high number of executions in Scotland was the intensity of the Reformation, the ‘godly’ state and the authorities trying to get everyone to behave in a godly manner.

“The Reformation divides Europe, half of Europe is Protestant, half is Catholic. Each hates the other, and each wants to prove they are more godly than the other.

“They thought ‘we have to make ourselves as godly as we can’. And one thing they believe in is that the end of the world is approaching, and they haven’t got much time left.

“They work this out by various ways of reading the bible, looking at problems they have such as instability and civil wars and think this is the time before the second coming of Christ; a time of importance when we have to be on our guard against the devil because he will rage in the final years before the second coming and because he knows he hasn’t got much time left.”

Fear of witches was also fuelled by King James VI, who believed he and his Danish bride, Anne, had been targeted by evil forces trying to kill them in fierce storms which disrupted their travels across the North Sea.

He sanctioned witch trials and published his treatise Daemonologie, which suggested the devil unleashed his demons to make pacts with people, granting them magical powers to do his evil work.

Out of the 4,000 Scots accused under The Witchcraft Act of 1563 – which remained in law in Scotland until 1736 - 85% were women.

Some did not even have a chance to go to trial: in 1704 Lilias Adie, known as the “Torryburn Witch”, died after enduring torture during which she ‘confessed’ to meeting with the devil.

“She died without being convicted so wasn’t a criminal, they couldn’t burn her and decided to bury her in an unconsecrated grave on the shore, below the high tide mark and low tide mark, with a huge stone on top of her,” added Prof. Goodare.

Her remains were exhumed in the 19th century and her skull photographed before going missing. In 2017, forensic scientists used the images to reconstruct her image.

“To meet her face to face is a remarkable experience,” said Prof. Goodare. “She looks like someone you’d see on the bus.”

Although witch-hunting from a modern perspective seems scandalous, Prof Goodare pointed out that those involved believed they were saving themselves and society from evil.

“In times of panic, people want simple answers and tough action,” he added.

Very Rev Dr Susan Brown, convener of the Church of Scotland’s Faith Impact Forum said: “The mistreatment and execution of thousands of people accused of witchcraft during the 16th and early 17th centuries, the majority of whom were women, is an example of ignorance and cruelty.

“The direct involvement of the Church in many instances, is something we look back on with deep sadness and sincere horror and sorrow.

“A statement of apology on behalf of the Church, under our structure, would have to be made by the General Assembly, which is the only body able to speak for the Church of Scotland as a whole.

“The General Assembly of 2021 heard a request to consider a retrospective apology in relation to the Church’s treatment of people accused of witchcraft. This work is underway and is being taken forward by the Church’s Theological Forum.”

She added: “It is so important that Scotland’s history should be researched and an honest appraisal given both of what happened and of the wider contextual complexities.

“It is such honesty that helps us to understand the past in order that our lives and our future can be shaped by it.”

Rev Brown added: “We welcome a wider national conversation about that history and of its treatment of those accused of witchcraft, a conversation that would also examine the role of local magistrates, town councils and the Crown.

“It is through a deepening of our collective understanding and through reflection on the causes, that we begin to reach the truth, and more importantly, it will help improve current culture where sadly, women still bear the brunt of societal violence in so many ways.”