The former Archbishop of Canterbury has accused the Church of England of an “appallingly violent” attitude towards gay people.

Writing in the Cambridge student paper The Tab, Dr Rowan Williams said: “The Church has to put its hands up and say our attitude towards gay people has at times been appallingly violent. Even now it can be unconsciously patronising and demeaning.”

When asked “On the issue of homosexuality and gay marriage, do you consider your own views and those of the Church as being out of touch with the views of your students at Cambridge, and do you think that’s a problem?”

Dr Williams replied: “I think it is quite a problem. This is the one area where there is the deepest sense of the Church being out of step with what the rest of the culture take for granted. I think it’s quite difficult for some people outside of the Church to recognise that there is something in the matter of several thousand years of assumption, reflection and ethical practice here which isn’t likely to be overturned in a moment.

“But, all that being said, I think the Church has to put its hands up and say our attitude towards gay people has at times been appallingly violent. Even now it can be unconsciously patronising and demeaning, and that really doesn’t help. We have to face the fact that we’ve deeply failed a lot of gay and lesbian people, not only historically but more recently as well. I think that there is a very strong, again theological, case for thinking again about our attitudes towards homosexuality: but I’m a bit hesitant about whether marriage is the right category to talk about same-sex relation, and I think there is a debate we haven’t quite had about that. But in a sense that’s water under the bridge, the decision has been taken, things move on. Looking back over my time as Archbishop I think that’s what most people will remember about the last ten years: ‘oh, he was that bloke who was so bogged down in issues about sexuality’.”

Dr Williams retired as leader of the Church of England and head of the 85 million-strong Anglican Communion in December last year.

Appearing at the Edinburgh International Book Festival in conversation with Britain’s second female rabbi Baroness Julia Neuberge in August, Dr Williams said he regularly questioned whether he had let gay and lesbian people down during his time as Archbishop amid rows over the Church’s teaching on gay relationships.

“I know that is what a great many of my gay and lesbian friends would say that I did,” he said.

“I look back and I think, ‘at what point would it have been constructive to do something different that would have made a difference and take us forward?’, and I don’t know, it’s quite soon to say.

“It’s a slow fuse. The best thing I can say is that that is a question which I ask myself really rather a lot, and I don’t quite know the answer.”

As Archbishop in October 2012 Dr Williams admitted that the Church of England’s attitude to gay relationships had often been harmful to people on the receiving end of its message.

In the previous month Dr Williams said that while the Church was “wrong” not to have advocated gay equality, Prime Minister David Cameron was wrong to have embarrassed the Church of England over the issue of equal marriage.

The current Archbishop of Canterbury Justin Welby admitted that the Church’s opposition to equal marriage was “utterly overwhelmed” by vocal supporters in July.