In one of his last major public lectures before he steps down later this year, the Archbishop of Canterbury, Dr Rowan Williams, admits the Church of England’s attitude to gay relationships has often been harmful to people on the receiving end of its message.

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

According to the Telegraph, in a wide-ranging lecture to the think-tank Theos in London on Monday evening, Dr Williams suggested the church could learn lessons from its mistakes.

“We are trying to catch up with a reality which for a long time we didn’t handle at all well,” Dr Williams said.

He went on: “I think the church has in recent years tried quite hard to say we are not condemning a person as such for their sexual orientation and that is a serious commitment.

“Nonetheless there is a hang-over from the feeling that you are condemned in your entirety for what you are doing, for what you are.

Dr Williams continued: “If people are getting the message that they are condemned for what they are then of course there is a serious mental health impact, I hope this is not what the church is doing and I certainly don’t think it is what the church should be doing.

“It is not just the church it is also a climate of homophobia which still exists in our society, we still have work to do.”

Dr Williams’ remarks came amid continued uncertainty over the selection of his successor.

Despite meeting last week for what had been scheduled to be the final time, the Crown Nominations Commission appears to be divided over which two names to pick as its first-choice and back-up candidate.

Religious commentators say whoever is appointed to succeed Dr Williams are likely to be a far more socially conservative in their rhetoric.

The Archbishop of York, Dr John Sentamu – the second most senior bishop in the Church of England and highly favoured for the post – has already outlined that he is strongly opposed to the government allowing equal marriage rights for gay couples.