MEXICO CITY — Across the globe, Pope Francis’s comments endorsing same-sex civil unions were received by some as encouragement for an advancing struggle and condemned by others as an earth-shaking departure from church doctrine.

In the Philippines, officials saw the potential for political change in the wake of the pope’s words. In Zimbabwe, activists for equal rights applauded the move, but doubt it would quickly bring change in a country where discrimination against the LGBT community continues to be widespread.

Nowhere was reaction more divided than in Latin America, where the Roman Catholic Church remains influential — and where some countries have legalized same-sex marriage in recent years over objections of the church.

Earlier this year, Costa Rica became the sixth country in Latin America to allow same-sex marriage. Ecuador legalized it last year, and Panama is in the midst of a heated debate on the subject now. It is also permitted in some parts of Mexico as well as Brazil, Argentina, Colombia and Uruguay.

The latest push has been propelled in part by an opinion issued in January 2018 by the Inter-American Court of Human Rights. It said the 25 countries that signed the American Convention on Human Rights had to guarantee that all rights available to heterosexual couples were also extended to homosexual couples.

The Catholic Church, however, has fought against these changes. When Francis was serving as archbishop of Buenos Aires, he endorsed civil unions for gay couples as an alternative to same-sex marriages.

Francis apparently made the newly released comments in a 2019 interview, a portion of which was not aired publicly until the documentary “Francesco” premiered Wednesday.

The mixed reaction was on display in Mexico, where the pontiff’s comments were condemned by conservative sectors and praised by more liberal church leaders.

“The Episcopal conferences have been stunned,” said Hugo Valdemar, a former spokesman for the Mexico City archdiocese who is close to Cardinal Emeritus Norberto Rivera, one of Mexico’s most conservative church leaders. “I believe there is going to be an ominous silence from some and applause from the most liberal.”

Pope Francis’s comments go against all of the teaching from Pope John Paul II and Pope Benedict XVI and “that is what is disconcerting,” Valdemar said. “Even though it is not an official document it is an opinion that the pope can’t allow himself because he is not a monarch with absolute authority, he must act within the framework of church doctrine.”

Valdemar said the comments would deepen the schism already dividing the church. “This is going to give all of the pope’s enemies the weapons to attack him,” he said.

At the liberal end of the church spectrum in Mexico, Saltillo Bishop Raúl Vera celebrated the pope’s comments like a breath of fresh air.

“It makes me very happy that a new door is opening in the church for people who still don’t have a place in it because God is going to ask about them,” the 75-year-old Vera said, adding that those who suggest Francis’ comments were misinterpreted just don’t want to hear the message.

“It is very important that we initiate a new stage in the relationship of the Catholic Church with the LGBT family in the world,” Vera said.

That was what Aldo Dávila, an openly gay lawmaker in Guatemala, where same-sex unions are banned, heard in Francis’ words.

“This demonstration of tolerance, love and respect toward people is important, especially now that we see various Central American countries evolving,” Dávila said. “Panama is talking about the issue, Mexico and Costa Rica have passed laws, maybe this can help.”

But some reactions made clear change will not come easily in parts of the region.

Monsignor Daniel Fernández Torres, bishop of Arecibo in Puerto Rico, rejected Pope Francis’s comments, saying “they can’t change the Catholic Church’s doctrine or go against it.” He said he would continue to follow the texts published under Pope John Paul II that said the church’s respect for homosexuals cannot in any way lead to the approval of homosexual behavior.

In La Paz, Bolivia, gay rights activist David Aruquipa, who has been fighting in court for 11 years for legal recognition of his relationship with his partner, took heart in the pope’s words.

“For those of us seeking recognition, I believe it has been very pertinent to the legalization of civil unions so that any couple and family of people of the same sex have civil rights,” Aruquipa said.

In Zimbabwe, home to more than 1 million Catholics, those pushing for equal treatment of homosexuals saw the pope’s comments as a step forward, but said it would change little in a country where same-sex relationships are frowned upon and often attract public ridicule, and where same-sex marriages are banned.

“We still suffer from basic humiliations such as the criminalization of sexual acts between men and vitriolic verbal attacks and ridicule from our leaders,” said Chester Samba, director of the Gays and Lesbians of Zimbabwe.

In the Philippines, home to the most Catholics in Asia, there was condemnation from some church leaders, but optimism in the political realm.

Harry Roque, spokesman for President Rodrigo Duterte, said the president has long supported same-sex civil unions and the papal endorsement may finally persuade legislators to approve them in Congress. In the past, such proposals have been opposed or avoided by conservative legislators or those who feared the ire of influential church leaders.

“With no less than the pope supporting it, I think even the most conservative of all Catholics in Congress should no longer have a basis for objecting,” Roque said.

Back in Latin America, earlier this month more than 300 people protested before Panama’s Supreme Court. For nearly four years, three lawsuits have been before the court demanding that same-sex marriage be legalized.

Iván Chanis, president of the Equal Foundation, said: “Today the Catholic Church got closer to what the many societies in the world already recognize: The respect for same-sex couples and their aspirations to make a family.”

Associated Press writers Danica Coto in San Juan, Puerto Rico; Juan Zamorano in Panama City; Paola Flores in La Paz, Bolivia; Sonia Pérez D. in Guatemala City; and Farai Mutsaka in Harare, Zimbabwe, contributed to this report.