The move was also welcomed by equalities campaigners and other church groups. Scotland’s Churches Trust said the first weddings would take place soon.
The vote makes the Church of Scotland the largest church in the UK to allow gay marriages, increasing the split within the Protestant faith. It has already allowed gay ministers to marry.
Faced with the threat of a global revolt within the Anglican communion, the Church of England has consistently refused to approve same-sex marriages.
In 2017 the Scottish Episcopal church, which is Anglican, voted at its synod to approve same-sex marriages, becoming the first in Scotland to do so. The Church of Wales has indicated it may follow suit in several years’ time. Methodists, Quakers and the United Reformed church already conduct ceremonies.
The measure had already been supported in an indicative vote by Church of Scotland presbyteries, which are its local governing bodies, but critics warned it could increase internal rifts and leave the church open to legal action.
The Rev Scott Rennie, a minister at the centre of a bitter and protracted dispute in the church over the employment of openly gay clergy 13 years ago, told the general assembly he was heartened that despite the fear and uncertainty surrounding the proposal, it now had majority support.
“Marriage is a wonderful thing,” Rennie said. “My marriage to my husband, Dave, nurtures my life and my ministry, and frankly I do not think I could be a minister of this church without his love and support. It is always there in the background. Same-sex marriage is like opposite-sex marriage and it has its joys and sorrows, its glories and its tensions. It’s pretty normal, really.”
Another speaker, Craig Dobney, told the general assembly that its past opposition to gay marriages had alienated people: a primary school near his church had stopped using it after the church refused to appoint a gay minister. “I worry that our churches have become irrelevant to our communities,” he said.
There were warnings from opponents that the measure could expose ministers who opposed it to pressure and ostracism from equalities activists. Some are expected to call for stronger protection for traditionalists in church legislation at the general assembly on Wednesday.
The Rev Alistair Cook said he opposed the measure and would continue to refer to marriages taking place between a man and a woman. He said it was disingenuous to suggest this was a matter for individual ministers; this was church policy. “That is a deep theological change for the church,” he said.
The Rev Ben Thorp, another critic, said there would be continuing tensions for ministers and presbyteries, since more than a third of presbyteries had voted against it. Churches that refuse to participate risk being targeted by groups supportive of same-sex marriage, he said.
“It won’t be the end of the journey,” he said. “It won’t stop the decline of the church. It won’t make us suddenly more attractive to younger people. We will continue to be divided.”
The general assembly’s vote comes against a background of steeping declining numbers of church marriages in Scotland and a sharp fall in religious observance.