The Church of Scotland has taken a cautious first step towards allowing same-sex marriage among clergy.
The Kirk voted to agree to allow same-sex marriages but in a separate vote it decided to send the decision to presbyteries to ratify, using a safety mechanism called the Barrier Act.
It puts the Church on a trajectory towards accepting same-sex marriage among ministers.
The move, which comes five days after the Kirk agreed to civil partnerships among gay ministers, catapults the contentious issue back into the arena of debate, potentially for years.
The Church agreed to put the issue out to its presbyteries to vote, and then to bring back their decision to next year's assembly for a third and final vote.
Further study is also to be held into potential legal issues after Scotland made same-sex marriage law.
The annual gathering of senior Kirk figures including ministers, elders and deacons in Edinburgh, the General Assembly, supported continued examination of the issue.
Very Rev Iain Torrance, a former Moderator and convener of the theological forum, said the law on same-sex marriage was six months old while civil partnerships had been in place since 2004, allowing years of discussion.
He said they were not comparable.
He said: "We simply do not have that knowledge yet.
"We understand and acknowledge the benefits conferred by civil partnerships.
"What it provides is a public forum within which to express a committed love and legal protection like next of kin, insurance, pension and inheritance benefits."
Rev Kenneth Donald said: "I am really trying to get my head round this.
"I am a simple Bible-believing Christian, but I feel that if I agree with the deliverance I feel that I am agreeing with something that the Bible does not sanction."
Another former Moderator, Very Rev Albert Bogle, called for the theological forum to study the issue further without accepting the principle of same-sex marriage at this stage and to report in 2017.
He said: "It's not a fudge. We've come a long way. We didn't fudge the last one.
"This is an opportunity to take time."
Divinity academic Rev Professor David Fergusson, Principal of New College, said rejecting same-sex marriage could be seen as "at worst discriminatory".
The ordaining of ministers in same-sex relationships has divided the Church since traditionalist members attempted to block the appointment of Rev Scott Rennie, who is in a civil partnership, in Aberdeen in 2009.
Following the vote, theological and legal experts will study the implications of allowing same-sex marriages among ministers.
But it must now go under the Barrier Act, a legal tool to ensure important decisions are properly scrutinised, and presbyteries must give their views by December.
The assembly voted 213 to 205 to include same-sex marriage in its new law on civil partnership which it agreed on Saturday.
Then it voted 215-195 to allow presbyteries to have the next say on the issue.
The solemnisation of same-sex marriages is yet to be broached by the Church.
Hardline evangelists vowed to challenge the weekend assembly vote that supported the "mixed economy" position of allowing the ordination of gay clergy in civil partnerships by 309 to 182.
Some traditionalists believed the inclusion of same-sex marriage in the legislation was a "step too far".