Speaking on the eve of a visit to Scotland as the new chairman of Christian Aid, Williams said he understood some congregations might threaten to break away if the Kirk’s ­General Assembly votes to allow the ordination of gay ministers later this month, but warned against such a divisive move.

“The impulse to walk away, while deeply understandable, is not a very constructive one,” he said. “The things which bind Christians together are almost always more profound and significant for themselves and the world than the things that divide them. When you do walk away from other Christians you are in effect saying well, either I can do without you or I’ve got nothing to learn from you. That can’t be good for us. You may disagree, you may think somebody else is tacitly perverse, but you might want to hang in there with them.”

Williams’ remarks come ­after Scotland on Sunday ­revealed that up to 50 congregations could leave the Church of Scotland if the vote in ­favour of ordinating openly gay ministers is passed. Two congregations and a number of ministers have already left over the issue, which they ­believe goes against biblical teachings.

Although he said it would be “inappropriate to comment on a sister church with its own issues”, Williams said the church community was part of a wider family and there was a case for keeping it together.

“We are stuck with each other, in a very important way. If we believe as I do that God calls us into the church, rather than choosing to sign up, then God’s calling us to find our way in the company of these people however obnoxious some of them may seem. You don’t agree with all the members of your family, but it’s a family.”

Williams said he is “not convinced” of the case for gay marriage, having opposed legislation to introduce it in England, but added: “Because we are all breaking up over issues of sexuality these days, can we all stop and think why it is, this issue, sex is the great divider, given that we have lived with radically different approaches over the years, for example to pacificism.”

In the 1930s, divisions over how to respond to the rise of Nazism did not split the church. “That I would have thought is a pretty serious division of opinion,” said Williams. “The question of am I allowed to kill people, is at least as important as am I allowed to sleep with certain sorts of people.”

The issue of gay marriage and gay ordination dogged Williams during his ten-year tenure before he stood down as head of the Church of England last December.

In 2003 the then Archbishop approved the appointment of Canon Jeffrey John, a gay theologian, as suffragan bishop of Reading.