(CNN) -Pope Francis said Monday that he will not "judge" gays and lesbians - including gay priests - signaling a shift from his predecessor and offering another sign that the new pope is committed to changing the church's approach to historically marginalized groups.
"If someone is gay and he searches for the Lord and has good will, who am I to judge?" Francis said in a wide-ranging news conference aboard the papal plane.
Though he was answering a question about the so-called "gay lobby" at the Vatican, the pope seemed to signal a change in tone, if not in teaching, in the church's stance towards gays and lesbians more generally.
The pope was flying back to Rome from Brazil, where he spent the past week celebrating World Youth Day, an international Catholic event that drew millions.
Taking questions from reporters aboard the plane, the pope addressed nearly every hot-button issue facing the Roman Catholic Church: its alleged "gay lobby," Vatican bank corruption, the role of women, abortion, homosexuality and his own personal security.
But it was the pope's remarks on homosexuality - the head of a 1 billion-member church saying that he will not judge gays - that caused the widest stir.
"Pope Francis's brief comment on gays reveals great mercy," said the Rev. James Martin, a Jesuit priest and editor at America, a Catholic magazine based in New York.
Martin noted that Francis also showed "greater compassion for divorced and remarried Catholics, a group that has long felt marginalized in the church, and called for a `deeper theology' on the role of women in the church."
"Today Pope Francis has, once again, lived out the Gospel message of compassion for everyone," Martin said.
The pontiff spoke on the record for an hour and a half in the back of the plane that was carrying him back to Italy after his first international trip as pope to Brazil, where he was greeted by massive, frenzied crowds at every turn.
"I'm happy. It has been a beautiful trip, spiritually speaking; it has been good to me. I'm tired enough but with a heart full of joy," he said.
On Sunday, the mayor's office in Rio de Janeiro said more than 3 million people came to Copacabana Beach for a morning Mass with Francis, who was in Brazil for the weeklong World Youth Day celebration.
Security issues plagued the trip because of Francis' immense popularity as the first Latin America pope. His arriving motorcade was mobbed after a wrong turn, prompting the Brazilian military to raise the trip's security level to "high risk" and send in reinforcements to protect the pontiff, who insisted on being close to the people.
"There is always the danger that there is the crazy person, and we never know what he or she will do," Francis said. "But to create a safety barrier between the bishop and its people is insane. And I'm outside this security. I prefer the risks of the madness outside, to be close to the people."
The pope addressed the issue of an alleged "gay lobby" within the church. Hints that the Holy See contained a network of gay clergy surfaced last year in reports about a series of embarrassing leaks to Italian journalists.
The "Vatileaks" scandal factored in Benedict's shocking decision to resign this year, according to some church experts, as it impressed upon the 86-year-old pontiff that the modern papacy requires a vigorous and watchful presence.
"There's a lot of talk about the gay lobby, but I've never seen it on the Vatican ID card!" Francis said.
"When I meet a gay person, I have to distinguish between their being gay and being part of a lobby. If they accept the Lord and have goodwill, who am I to judge them? They shouldn't be marginalized. The tendency (to homosexuality) is not the problem ... they're our brothers."
The problem, he said was, lobbies that work against the interest of the church.
In 2005, during the papacy of Pope Benedict XVI, the Vatican issued directives barring from the priesthood men "who are actively homosexual, have deep-seated homosexual tendencies, or support the so-called 'gay culture.'"
Francis' brief remarks seem to signal a sharp shift from that policy.