Pope Francis has reached out to gay people by saying the Catholic Church should embrace and not discriminate against homosexuals - but insisted the Vatican remains against gay marriage.
"If someone is gay and he searches for the Lord and has good will, who am I to judge?" Francis told journalists flying with him back to Rome from his first foreign trip in Rio de Janeiro.
"The Catholic social teaching says homosexuals have to be treated with dignity and not marginalised."
In June Francis, who has a reputation for free-thinking and liberalism, reportedly lamented the existence of a gay lobby in the Vatican, in remarks that seem to confirm earlier reports about corruption and malpractice in the Holy See.
"I still haven't found [gay] identity cards in the Vatican, but someone says there are some" the pontiff said at the end of a week-long trip to Brazil where he presided over the Roman Catholic World Youth Day (WYD) festival.
"It is, however, important to separate the fact of being gay from that of lobbying," Francis added.
"The problem is not having these kinds of tendencies - we are brothers - the problem is making a lobby out of it, as it is for all sorts of lobbies: business lobbies, political lobbies, freemasonry lobbies etc."
Although homosexuality is still considered a sinful practice by the Catholic Church, the Pope's words are being seen as more conciliatory than those of his predecessor Benedict XVI - who in 2005 signed a document that said men with deep-rooted homosexual tendencies should not be priests.
Francis said repentant gay clergymen should be forgiven and their sins forgotten.
Despite the softer approach towards gay priests, Francis sided with Benedict's hard line over gay marriage.
Even before being elected in March, Francis had spoken out strongly against gay marriage, denouncing it in 2010 as "an attempt to destroy God's plan".
Earlier this month, Francis and Benedict penned an unprecedented joint encyclical restating the Catholic Church's position on marriage, saying it should be a "stable union of man and woman."
"The church has a clear stance on the subject and it was important to speak positively in Brazil," Francis told journalists who asked him why the issue of homosexuality wasn't raised during his trip to Rio.