At its annual meeting, the Church of Scotland's general assembly approved a motion to draft new laws that will allow ministers to marry gay and lesbian couples.

The motion, introduced by the Rev. Bryan Kerr, cleared the body with a 345 to 170 vote on Saturday, The Guardian reported.

The church's legal questions committee will draft the law and report back in two years.

Under the plan as outlined in the motion, ministers and deacons will be allowed to marry same-sex couples “if they wish.”

Last year, the Scottish Episcopal Church became the first church in the UK to allow gay couples to marry in church.

The Rev. Tom Gordon said before the vote that he has two daughters, both of whom are married.

“I have one gay daughter in a same-sex marriage,” Gordon said. “When my older daughter got married, she had a choice – to ask me to conduct her service as a minister or for me to walk her down the aisle as her dad. But when my younger daughter got married, she had no such choice.”

“Give people a choice: allow their marriage to be conducted by a minister. With God's blessing,” he added.

The Church of Scotland opposed extending marriage rights to gay couples when it was being debated. Scotland introduced civil partnerships for gay couples in 2005 and marriage in late 2014.