THE Church of Scotland has warned it may stop conducting marriage ceremonies altogether for fear of legal challenges if gay couples are given the right to wed.

One of the Kirk's most senior figures warned the Marriage and Civil Partnership Bill, now going through Holyrood, could be an "invitation" to drag religious bodies through the courts.

The Rev Alan Hamilton, convener of the Kirk's legal questions committee, said a number of Kirk committees were considering whether it was "worth" continuing to perform marriage ­ceremonies at all.

The Kirk says it will exercise its right not to perform same-sex marriages if, as expected, the legislation is approved by MSPs - a decision that would mean individual Church of Scotland ministers would not be allowed to marry same-sex couples irrespective of their personal views on the issue.

But Mr Hamilton said the Kirk - the biggest provider of religious marriages in the country - feared court challenges from individuals or groups as a result of its position.

Giving evidence to Holyrood's equal opportunities committee he said: "We are voluntary bodies.

"We rely upon the donations of our members, and the thought of years of exhausting legal challenge, which is also incredibly expensive, is really very concerning.

"That is why the General Assembly of 2013 in May of this year instructed my committee, together with other councils and committees of the Church of Scotland, to consider whether in fact - and I'm saying this colloquially, this is not the terms of the deliverance of the General Assembly - whether it's worth the Church of Scotland continuing to offer marriages in Scotland."

He added: "It gives us considerable problems internally - we're deeply concerned about the threat externally."

The official terms of the instruction to the Kirk's legal questions committee emerged in a "remits booklet" report by the General Assembly.

It called for the committee to "explore the possibility of ministers and deacons ceasing to act as civil registrars for the purpose of solemnising marriages and report to the General Assembly of 2015".

The Kirk confirmed the move in a statement later in the day.

It said: "Members of the Church wanted to explore the case for church services being an optional extra after a civil ceremony, given the potential for ministers to be subject of legal action following the proposed legislation on same sex marriages."

Mr Hamilton stressed there were no immediate plans to scrap marriages.

He said: "Marriage is a binding force for good and will continue to be so for many years and generations to come. We are simply urging that any legislation if approved is robust enough to protect those who in conscience will not want to conduct such ceremonies."

The Scottish Government insisted the Kirk's fears were unfounded.

A spokesman said: "The Scottish Government is putting in place very clear and robust protections for both churches and individual celebrants, which would cover the concerns of the Church of Scotland.

"For example, religious bodies will have to opt in for their celebrants to be able to solemnise same-sex marriages.

"Should a body choose to opt in, there is no obligation on any individual ­celebrant of that body to take part."

In addition, the UK-wide Equality Act is being changed at Westminster to protect religious celebrants from court actions if they refuse to take part in same-sex ceremonies. The spokesman added: "Added to this, the European Convention on Human Rights has provisions protecting the freedom of thought, conscience and religion. There is no evidence of religious celebrants in other European countries which have same sex marriages being forced to conduct them."

Tom French, of the Equality Network campaign group which is pro same-sex marriage, said: "Scotland's equal marriage bill provides strong and robust protections for religious bodies that do not support same-sex marriage. Almost every country surrounding Scotland already has same-sex marriage, and in none of those countries has any religious body ever been forced to conduct same-sex marriages against its will. There is no reason to think Scotland would be a special case."

More than 5500 couples married in Church of Scotland ceremonies last year.