A controversial law allowing same-sex couples to marry has passed its first key test at the Scottish Parliament.
MSPs backed the change in principle with a 98-15 vote and five abstentions, after a debate which underlined fundamental divisions between supporters and opponents.
The Scottish Government hailed the endorsement as an important step forward.
But some politicians, including SNP members, voiced concerns that the move fails to recognise the rights of faith groups that oppose the state's interference in changing the definition of marriage.
Scotland's Health Secretary Alex Neil said: "In a country that aspires to be an equal and tolerant society, this is the right thing to do.
"It is encouraging we have secured the support of Parliament at stage one of the Bill and that we have agreed the general principles.
"It is an important step on the journey but we will continue to work closely with the Parliament as the Bill goes forward."
Under the terms of the Marriage and Civil Partnership (Scotland) Bill, religious bodies will have to opt in to perform same-sex marriage ceremonies.
Scottish ministers reached an agreement with the UK Government to amend the Equality Act to ensure protection can be offered to individual celebrants who feel it would go against their personal faith to carry out gay weddings.
Politicians were given the opportunity to vote freely, not having to toe any party line.
Among those voting No were Scottish Government ministers Roseanna Cunningham and Fergus Ewing, joined by four SNP backbenchers, eight Conservatives and one Labour MSP.
Conservative leader Ruth Davidson, in a highly personal speech in favour of the Bill, spoke of her experience growing up as a gay woman.
"I don't want the next generation of young gay people growing up, as I did, believing that marriage is something they can never have," she said.
"We have the opportunity with this Bill to change that, and to change the attitudes and even the stigma that being lesbian, gay, bisexual or transgender can still evoke and which can can cause so much harm."
Labour MSP Elaine Smith spoke strongly against the Bill, and was the only one from her party to vote No.
"Since indicating that I did not intend to support the redefinition of marriage, my religion has been disparaged, I have been branded homophobic and bigoted, I have been likened to the Ku Klux Klan, and it was suggested that I be burnt at the stake as a witch," she said.
"MSPs have a responsibility to ensure that to the best of their ability they are not introducing legislation with consequences, albeit perhaps unintended, that will negatively impact on society."
Her party colleague Jackie Ballie commended the Scottish Government for taking forward the Bill.
"For many of us, this is about how we see ourselves as a nation and how others see us - about the values that we hold and whether Scotland is indeed a confident, progressive nation where equality is truly valued," she said.
Three Labour MSPs abstained - Hanzala Malik, Michael McMahon and Siobhan McMahon.
SNP member John Mason voted against the Bill, warning that Parliament was "not reflecting public opinion".
His SNP colleague Marco Biagi said: "When I came out, it was the time I stopped looking at those around me and wishing I was the same as them, and instead started to wish I had the same rights as them."
Green leader Patrick Harvie dismissed some of the arguments against the legislation as spurious, silly, mischievous or curious, but warned against ignoring other "serious" arguments.
"They should be confronted and defeated because they assert, whether they do so in religious terms or any other, they assert basically the lesser worth, the lesser dignity, the lesser status or the lesser value of LGBT people and our relationships," he said.
Lib Dem Jim Hume hailed the vote as "a big step forward for equality".
Tom French, of campaign group the Equality Network, said: "This vote is a huge step forward which will send out a strong message that LGBT people are equal and valued members of our society."
The Rev Dr Alan Hamilton, from the Church of Scotland, said marriage was between one man and one woman.
"Until any future General Assembly of the Church of Scotland decides otherwise, that remains our position," he said.
"But our commitment to care for all people, gay and straight is no less. We stand against homophobia."