The Scottish Episcopal Church has forged ahead to become the first UK Anglican church to legalise gay marriage in a historic move that sets it on a collision course with other Anglican churches around the world.
A motion that changes church law was passed narrowly passed on Thursday afternoon.
The groundbreaking move means Scottish Anglican ministers will be allowed to conduct same-sex weddings, but conservatives have announced a controversial 'missionary bishop' to minister to those opposed to gay marriage.
Gay couples in Scotland can expect to wed in churches by the end of the year, with a 'conscience clause' meaning no priest will be forced to celebrate LGBT weddings if they do not want to.
Primus of the SEC, Most Rev David Chillingworth, said: 'A new chapter opens up and inclusion takes a particular form.
He told the synod: 'This new canon affirms there are different understandings of marriage in our church.
'We affirm we are a church of diversity and difference bound together by our unity in Christ.'
The motion needed to be passed by a two thirds majority across the three 'houses' of synod - the bishops, clergy and laity. Bishops voted by 4-1 (80 per cent) for it, the clergy by 42-20 (67 per cent) and the laity by 50-12 (80 per cent).
But the move will enrage conservatives in Scotland and around the world and could lead to retribution for the SEC.
Last January The Episcopal Church in America was handed 'consequences' for legalising gay marriage, going against most fellow-Anglicans around the world who are largely traditionalist.
A spokesman for the Archbishop of Canterbury declined to say whether the SEC would face the same 'consequences'.
But The Church of England responded by saying its own doctrine remained unchanged but also admitted 'this is a matter on which there is real and profound disagreement' and said it is seeking ways forward rooted in Scripture and the Christian faith.
GAFCON, a group of conservative Anglicans deeply opposed to the change, announced a 'missionary bishop' minutes after the vote, effectively setting up a rival Anglican church in the UK.
Traditionalist parishes can pledge allegiance to the new bishop, rather than their official local bishop.
The move triggers a split in the UK Anglican church and is likely to cause further rifts with other Anglican churches.
But the Bishop of Edinburgh John Armes said: 'If the Anglican Communion is to survive, it must embrace unity.'
He said clergy were already allowed to exercise 'pastoral discretion' at any wedding, including whether to remarry divorced people.
The change in law 'now extends this protection of conscience to the marriage of same-sex couples,' documents sent to synod members read.
'It permits those clergy who, on the grounds of conscience, wish to conduct the marriages of same-sex couples, to seek nomination to do so; it also allows that there will be those who, on the grounds of conscience, will not seek such nomination. We believe that the consciences of both are protected in the revised Canon.'
The change effectively means the church does not hold any official teaching on marriage with the motion removing the old understanding as 'a physical, spiritual and mystical union of one man and one woman'.
Instead the teaching reads: 'In the light of the fact that there are differing understandings of the nature of marriage in this Church, no cleric of this Church shall be obliged to conduct any marriage against their conscience.'
Bishop John Armes said the approach 'models a hopeful possibility for the whole of the Communion'.
He said: 'No one is being asked to change their theology.'
But Rev Ian Ferguson told synod the move meant going against Jesus' teaching on marriage.
'This is one of the saddest and most painful days for many of us,' he said. 'Changing our doctrine of marriage is a schismatic move that will cause serious harm to our unity and future relationship' with other Anglicans.
Beth Routledge, another member of synod, said it was wrong to assume everyone in the Anglican Communion opposed it.
'The Anglican Communion is a very broad church indeed and it works in a very wide world,' she told synod.
'There are many people beyond these borders who are watching what we are doing today and cheering us on.'
A spokesperson for the Church of England said the decision was a matter for the Scottish Episcopal Church.
'The Church of England is unable by law to marry couples of the same sex and the teaching of the Church of England remains unchanged.
'However this is a matter on which there is real and profound disagreement in the Church of England.
'We are seeking to find ways forward rooted in scripture and the Christian faith as we have received it and which values everyone, without exception, not as a "problem" or an "issue", but as a person loved and made in the image of God.'
Archbishop Josiah Idowu-Fearon, secretary general of the Anglican Communion, said the SEC is 'autonomous and free to make their own decisions on canon law but the move puts it 'at odds with the majority stance that marriage is the lifelong union of a man and a woman.
'This is a departure from the faith and teaching upheld by the overwhelming majority of Anglican provinces on the doctrine of marriage,' he said, urging the churches against formal splits, and adding:
'The primates of the Communion will be meeting in Canterbury in October. I am sure today's decision will be among the topics which will be prayerfully discussed. There will be no formal response to the SEC's vote until the primates have met.'