The Church of Scotland is to allow ministers and deacons who are in same sex marriages to continue to serve after a decisive vote for reform at its General Assembly.

Kirk representatives voted by a margin of 339 to 215 to back the shake-up on the first morning of the annual gathering held in Edinburgh yesterday - despite some members saying the outcome was "against Jesus Christ".

Church of Scotland leaders said they hoped the decision would draw a line under a row about same sex marriage within the Kirk, which has split congregations and members for nine years.

However, one minister, the Rev John Nugent from Wick, said he was "profoundly disturbed at some language" used by some of those taking part in the session, after opponents of reform suggested that a vote to allow gay ministers to marry was a vote against the Christian religion.

Rev Prof Andrew McGown of Inverness said that allowing ministers who are in gay marriages to continue to serve in the church "stands contrary to the plain teaching of scripture".

He said: "This matter has decimated the Church. Thousands of members and adherents have left the Church, sometimes whole congregations. This has been particularly damaging in the highlands and islands.”

Arthur C Custance, a church elder from Kinlochleven, said that a “vote in favour of homosexuality is in effect voting against Jesus Christ.”

Since 2008, 25 ministers have left because of discussions over ministers in same sex relationships. This represents just 3% of the total number of ministers.

The decision means that same sex marriage will be permitted for ministers, who the Church of Scotland Assembly last year agreed would be allowed to enter into civil partnerships.

A report on same sex marriage by the Theological Forum is being prepared and will be presented to the Church of Scotland in March next year, about six weeks before the start of the 2017 General Assembly.

However, the Very Rev John Chalmers, Principal Clerk to the General Assembly, said that yesterday's vote was about "tidying up" the law of the Kirk and bringing it into line with Scots law, which now allows for same sex marriage.

He said: “We had a debate which made very clear that we were not interfering with our theological definition of marriage and were not going to the place where ministers or deacons could themselves conducting same sex marriages. It is an entirely different discussion.

“Today’s decision means it will be possible for Kirk sessions and congregations to depart from the traditional understanding of marriage to call not only potentially a minister in a civil partnership but one who is in a same-sex marriage.

“In some ways we crossed the Rubicon last year when it was agreed that kirk sessions could call someone in a civil partnership and for many people what today was about was simply tidying up and making the law of the church consistent with Scots law.”

Chalmers, speaking after the debate appealed for unity in the wake of the vote yesterday and said that next year's report would reflect different views on marriage within the Kirk.

He said “Today I think people came to this decision with their minds on law and practice and not on theology and future practice.”

He added: “I hope we have now put this issue to one side and we can now get on with what I believe are important issues – developing our vision for the church, increasing membership and developing our work around mission.”

The latest changes differentiate the Kirk from the Church of England, which bans clergy from being married to partners of the same sex and has refused to allow gay church weddings.

However, they will not themselves be allowed to conduct gay weddings within the Church of Scotland.