The Church of Scotland has voted to allow its gay ministers to marry.
The General Assembly meeting in Edinburgh voted 339 votes to 215 to update church law to bring it in line with secular Scottish law. The church already recognised ministers and deacons in same-sex civil partnerships and has today extended that to cover same-sex marriage.
The Church said in a statement immediately after the vote that the decision "does not compromise the Church's traditional view of marriage as a union between one man and one woman."
And it does not mean church ministers will be able to register same-sex civil partnerships or solemnise same-sex marriages themselves.
Since 2008, 25 ministers have left the Church of Scotland because of discussions over ministers in same sex relationships. This represents three per cent of the total number of ministers.
The measure was approved at last year's General Assembly and then sent for scrutiny to presbyteries throughout Scotland, who voted 26 to 19 to refer the issue to the General Assembly.
Speaking after the vote, the Very Rev John Chalmers, principal clerk, said: "We had a debate which made very clear that we were not interfering with our theological definition of marriage and were not going to the place where ministers or deacons could themselves conducting same sex marriages.
"It is an entirely different discussion.
"Today's decision means it will be possible for kirk sessions and congregations to depart from the traditional understanding of marriage to call not only potentially a minister in a civil partnership but one who is in a same-sex marriage.
"In some ways we crossed the Rubicon last year when it was agreed that kirk sessions could call someone in a civil partnership and for many people what today was about was simply tidying up and making the law of the church consistent with Scots law."
A report on the Christian understanding of marriage is expected to be presented to the General Assembly next year.
Mr Chalmers said: "Today I think people came to this decision with their minds on law and practice and not on theology and future practice."
He added: "I hope we have now put this issue to one side and we can now get on with what I believe are important issues – developing our vision for the church, increasing membership and developing our work around mission."