Scotland's largest protestant church has swept away centuries of tradition and voted to allow gay men and lesbians to become ministers, opening up the prospect of the church allowing civil partnerships for same-sex couples.

The Church of Scotland imposed a temporary moratorium in 2009 on admitting gay and lesbian ministers after Scott Rennie became the first openly gay clergyman in a homosexual partnership to be officially appointed as a minister in the church.

The church's general assembly, its law-making body, voted on Monday to lift that moratorium, officially officially allowing gay ministers to take on parishes for the first time since its formation 450 years ago.

The general assembly also allowed serving gay and lesbian ministers who have kept their sexuality private to openly declare their sexuality – a proposal bitterly resisted by evangelical and conservative ministers.

In one of the final votes, the general assembly chose by a small majority to lift a parallel ban on ordaining and training people who are in same-sex relationships, and gay and lesbians in civil partnerships. It called for a new report by 2013 on both proposals and on allowing ministers to bless gay and lesbian relationships.

The vote followed official warnings that allowing gay clergy could split the church, forcing traditionalists to resign and join more conservative churches formed after the last great schism, when 474 ministers resigned in 1843.

A commission set up in 2009 to investigate the implications of the Rennie affair predicted that up to a fifth of the church's ministers, deacons and elders and 100,000 worshippers could leave in protest.

It said that the issue was so divisive that another 1,800 church leaders and 40,000 parishioners had warned they would leave if gay ministers were not admitted. The church has 445,000 communicants, or active members, and around 50,000 less-active parishioners.

A leading critic of the proposal, the Rev Andrew Coghill, a conservative minister on the Isle of Lewis, warned the general assembly that allowing homosexual clergy would be devastating to the church. To applause from his supporters, Coghill said the proposal to allow gay ministers was "the hand grenade [and] we're being asked to pull the pin out, and it will blow the church apart."

However, the Rev Willem Bezuidenhout, a South African-born minister, urged the assembly to support the proposal. He likened opposition to homosexual ministers to South African pastors using the bible to justify apartheid.

"Some of the gay Christians I know will be much better Christians than I will ever be," he said.

Coghill was supported by a series of traditionalists, some of whom called for a final decision to be delayed. Ministers in Aberdeen said Rennie's ordination was so divisive it had "broken" the city's presbytery, its ruling body, leading to threats of violence against some members.

But in a clear indication of the general assembly's mood, the decision to allow gay ministers on principle went through unopposed, leading to the vote late on Monday to allow gay and lesbian ministers to be ordained and recruited.

In addition, the church has set up a commission to investigate the theological issues raised by the acceptance of gay clergy.

Delegates to the assembly, known as commissioners, narrowly voted down a proposal to delay final decisions until 2013 on whether gay and lesbian ministers had to be celibate, or whether they were allowed to be sexually-active and in long-term relationships.

They also rejected a proposal to prevent a minister who had not "come out" to their parishioners or presbytery before 31 May 2009, a cut-off date based on the general assembly's last debate on the Rennie affair, from declaring his or sexuality. That suggests gay and lesbian ministers who have kept their sexuality private could now openly declare it.