The Scottish Episcopal Church has voted to allow gay couples to marry in church.
It makes it the first major Christian church in the UK to allow same-sex marriages.
The vote to amend canon law on marriage, removing the stipulation that it is between a man and a woman, was carried by the Synod in Edinburgh.
It means that gay Christians from any Anglican Church can now ask to be married in a Scottish Episcopal Church.
Clergy who wish to officiate at gay marriages will have to “opt-in”.
The church said this meant that those who disagreed with gay marriage would be protected and not have to act against their conscience.
The Episcopal Church’s Bishop of Edinburgh, The Right Reverend Dr John Armes, said: “I am very pleased for the couples who can now have their relationships recognised by the church and blessed by God.
“I’m also pleased for what this means about our church and the way we have been able to do this. But obviously any change like this creates pain and hurt in some as well, so as a bishop of the church I feel for them.”