The Roman Catholic Church has excommunicated the popular Brazilian priest Father Roberto Francisco Daniel for teaching that same-sex marriage is OK.

Reuters reported that the church decided to impose on Daniel the rare punishment because he has "injured the Church with grave statements counter to the dogma of Catholic faith and morality."

Excommunication, or expulsion from the church, bars a believer from participating in the liturgy in a ministerial capacity, but encourages the guilty party to work toward restoring their relationship with the church.

Daniel, who is 47 years old and preaches at St. Anthony's Church in Jardim Bela Vista in the southeastern city of Bauru, had been ministering since 2001. Despite his excommunication, the priest has not backed down from his views.

"I feel honored to belong to the long list of people who have been murdered and burned alive for thinking and searching for knowledge," Daniel said on his social media network. "For Jesus Christ, prejudice did not exist. Jesus loved human beings regardless of social status, race, and sexuality."

Like many other countries around the world, same-sex marriage remains a controversial issue in Brazil. The government recognizes gay unions, but upholds the traditional definition of marriage between a man and a woman. The Roman Catholic Church, which is the most popular Christian denomination in Latin America, defends traditional marriage.

Daniel has also expressed other controversial views. According to Reuters, he suggested that adultery is acceptable as long as the person's spouse is aware of it and allows it.

"If someone is in an extramarital relationship and that relationship is accepted by the spouse, then faithfulness still exists there," the priest said. In a separate statement, he added that those views are "personal reflections that should be considered and discussed in the dialogue of the church."

"If you think it's a sin, then I have always been and always will be a sinner," the priest said.

"Who said that dogma cannot be discussed? For me it has become impossible to live the Gospel in an institution where freedom of thought and freedom of expression are not respected."

Pope Francis has not yet spoken out on the topic of homosexuality since he was elected as leader by the Vatican in March, but as archbishop of Buenos Aries in Argentina, he remained committed to the traditional definition of marriage.