A Catholic priest in Brazil has been excommunicated after he publicly resigned in protest against the church’s opposition to gay rights.

Father Roberto Francisco Daniel resigned from his duties at the weekend. The 48-year-old priest was accused of “heresy” and “schism”, by the church.

A statement from the Bauru diocese in Sao Paulo state, said: “Father Roberto Francisco Daniel can no longer celebrate the divine rite because he has been excommunicated.”

Known as Father Beto, he announced on social media sites that he was to give up the priesthood, and urged the church to change its views to become more accepting of homosexuality and bisexuality, referring to “new realities”.

“We should simply be considered as gendered beings and not as homosexuals or bisexuals since love can spring at all these levels,” Father Beto said in a video posted on YouTube.

“For me it has become impossible to live the Gospel in an institution where freedom of thought and freedom of expression are not respected.”

Brazil is the world’s biggest Catholic country, and will welcome Pope Francis in late July, during a festival in Rio de Janeiro.

Meanwhile, a Catholic priest in Argentina was recently expelled from the church following an investigation after he voiced his support for equal marriage in the country.

The investigation into the priest, Jose Nicholas Alessio, was previously led by the new Pope, Francis, then known as Jorge Bergoglio, and then archbishop of Buenos Aires.

At the weekend it was revealed that the Catholic Church is to take no further action over Cardinal Keith O’Brien’s admission of inappropriate “sexual conduct”, following accusations from four priests.

The 75-year-old, who contested the first set of allegations, resigned as leader of the Scottish Catholic Church in late February.

In March, he admitted that his “sexual conduct” had been “below the standards expected” of him. The Vatican then claimed it would conduct an inquiry once the new pope was in place. Pope Francis was appointed on 13 March.