The Church of Scotland General Assembly has voted to affirm its historic position on homosexuality but with opt outs for revisionist churches that choose to be headed by ministers in same-sex civil partnerships.
The compromise vote came after the former Moderator of the General Assembly, the Very Reverend Albert Bogle tabled a new motion in an attempt to bridge the gap between the original revisionist and traditionalist motions on offer.
His version was adopted after motion 2b advocating only a traditional understanding of same-sex relationships fell in the first round of voting.
Bogle's motion 2d asked commissioners to "affirm the Church's historic and current doctrine and practice in relation to human sexuality" but "nonetheless permit those Kirk sessions who wish to depart from that doctrine and practice to do so".
It also allows ministers and deacons, current and prospective, in civil partnerships to be selected for training.
Motion 2d was passed by 340 votes to 282, defeating motion 2a, which had asked the Church to continue on a revisionist trajectory with an opt-out for traditionalist congregations.
The Legal Questions Committee will now have the task of drawing up the legal framework for liberal congregations wanting a minister in a civil partnership.
Their recommendations will be laid out in new legislation to be put before the next General Assembly in 2014. The Overture will then be referred to presbyteries according to rules under the Church of Scotland's Barrier Act, which prevents the General Assembly from making decisions on its own that radically affect Church policy.
Mr Bogle insisted his motion was not a delaying tactic but a way of giving the Church more time to move forward together.
He also admitted to commissioners that, as a traditionalist, the "permissive" motion was a considerable compromise on his own convictions.
"None of us will be completely happy but we'll get over it … and be able to grow together," he said.
"I'm moving a huge bit - you don't know how much - but that doesn't matter, we're moving together."
Explaining why he was prepared to compromise on the issue, he said: "Because I want to stand with my Greek Orthodox brothers and my Roman Catholic brothers and I don't want to be so divided that they will not understand."
In an impassioned debate, revisionists and traditionalists alike spoke of their desire to move on from years of difficult debate over an issue that has divided the Church and prompted congregations, ministers and individuals to leave.
Former Moderator of the Church of Scotland the Very Reverend Alan McDonald, who had argued for 2a said: "The time to do this is now. People don't want to wait any longer."
The Reverend Elisabeth Spence, the gay minister of Ibrox Parish Church, Glasgow, said the debate over homosexuality "undermines my call".
"Society has got bigger things to think about, the world needs us to do bigger things," she said. "It is time to decide so that those of us who are in this limbo can get under the wire."
The Reverend Dr David Ferguson said the "mixed economy" was the right direction for the Church to take not in a way that "enforced victory" on one side. He spoke of his respect for evangelical ministers and also expressed concern that continuing on a revisionist trajectory would put off more young evangelicals from joining or remaining in the Church of Scotland.
Seconding Bogle's motion, the Reverend Alan Hamilton said motion 2a was "too fast", "too painful" and "too destructive", but that it was time for traditionalists like himself to "concede space" to others with a revisionist view on homosexuality because the debate was "destroying" the witness of the Church.
Reverend David Randall was one of the few to take to the floor to speak against either form of mixed economy, saying the issue of homosexuality had been "forced upon" traditionalists.
He warned the Church against going with the "flow of social trends and political correctness", saying it was "no time for compromise" or "fudging of this issue".
He added: "Many feel they have been very patient with the Church of Scotland over these years but if we try and sit on the fence or a mixed economy, which is revisionism under another name, we will lose many more members and congregations, and defy the King and Head who has given us these Scriptures."
Principal Clerk of the General Assembly, John Chalmers, disagreed however, telling reporters it had been a "massive vote for peace and unity in the Church" and a "step change", although he admitted "the debate is not over".
Also speaking after the debate, the Moderator of the General Assembly of the Church of Scotland, the Reverend Lorna Hood praised commissioners for being "willing to listen to one another" and discussing the issues with a "huge amount of grace".