Scotland's First Minister has spoken of his sadness at the resignation of Cardinal Keith O'Brien, whom he described as a "good man for his church and country".

Responding to news the leader of Scotland's Catholic Community is stepping down immediately, Alex Salmond said: "I hear the news of Cardinal O'Brien's resignation with the greatest sadness.

"In all of my dealings with the Cardinal, he has been a considerate and thoughtful leader of the Catholic Church in Scotland, stalwart in his faith but constructive in his approach.

"It would be a great pity if a lifetime of positive work was lost from comment in the circumstances of his resignation.

"None of us know the outcome of the investigation into the claims made against him but I have found him to be a good man for his church and country."

In his statement, the First Minister referred to the visit of Pope Benedict to Scotland in 2010, which he described as a highlight of O'Brien's cardinalship.

Cardinal O'Brien is facing allegations of inappropriate behaviour.

The resignation means Britain has been left with no vote in the forthcoming conclave to elect a successor to Pope Benedict XVI.

Gay rights group Stonewall voted the cardinal "bigot of the year" last year for his comments on issues including same-sex marriage.

Stonewall Scotland director Colin Macfarlane said: "We hope his successor will show a little more Christian charity towards openly gay people than the Cardinal did himself."

John Haldane, Professor of Philosophy at the University of St Andrews, said Cardinal O'Brien resigned "in the interests of the Church".

He said: "The resignation of Cardinal O'Brien as Archbishop of St Andrews and Edinburgh, within a month of the date on which his formal resignation would normally have taken effect, is both shocking and sad, for he was a well-known and well-liked figure within the Catholic Church in Scotland, in Britain and more widely; and within Scotland he had good relations with other churches and faiths, and with civil and political society.

"Given the nature of the accusations, however, and the publication of them over the weekend, ahead of the formal abdication of Pope Benedict later in the week, it is unsurprising that he has taken the decision to resign."

Prof Haldane, who is a Vatican cultural advisor to the Pontifical Council, said: "He has ended his tenure as Archbishop of St Andrews and Edinburgh as he served the office, in the interests of the Church."

Scottish Conservative leader Ruth Davidson said: "I have met Cardinal O'Brien several times and I always found him to be a thoughtful, generous and sincere man.

"His resignation will be felt with sadness to those around him."

In November, Ms Davidson was named politician of the year by Stonewall, at the same ceremony as Cardinal O'Brien was named "bigot of the year".

When accepting her award she hit out at the bigot of the year category, saying it was "simply wrong" to use such terminology.