The Church of Nigeria (Anglican Communion) has introduced a clause in its constitution subjecting members, who intend to hold positions in church, to take an oath of allegiance to God denouncing homosexuality.
The public denunciation took place in Abuja on Sunday at St. Matthews, Maitama, during the swearing-in of new members of the Parish Church Council (PCC).
The Vicar of the church, Ven. Ben Idume, who administered the oath to members of the PCC, said the church recognised that those with such sexual orientation needed help and counselling.
The legislation is significant because it applies to members of the laity, clergy and house of bishops of the church.
It also banned bisexuals from holding any church office.
The text of the vow reads: "I declare before God and his Church that I have never been a homosexual /bisexual or (have repented from being homosexual/bisexual) and I vow that I will not indulge in the practise of homosexuality/bisexuality.
"If after this oath I am involved, found to be, or profess to be a homosexual/bisexual against the teachings of the Holy Scriptures as contained in the Bible.
"I bring upon myself the full wrath of God and subject myself willingly to canonical discipline as enshrined in the constitution of the Church of Nigeria, so help me God.''
One of the oath-takers, Mr Lucky Erhaikhuemen, 43, the Vicar's warden of the church, said two decades ago the oath would have been of no significance in the Church of Nigeria.
"But with what is happening in Western countries and the churches there, there is a lot a pressure on church leaders and members here to compromise the teachings of the church.
"The oath is a guide and warning that those in leadership positions in the church must uphold scriptural teachings and point to the godly part to the younger generations,'' he said.
In January, President Goodluck Jonathan signed a law banning same-sex marriages and shows of same-sex public affection.
The law introduced a 14-year prison sentence for people who are convicted of entering into a same-sex marriage or civil union.
Under the law it is also an offence to administer witness or help at a same-sex marriage ceremony.
The law also forbids people from running gay clubs, societies, processions or meetings in Nigeria and the punishment for such acts is 10 years in prison.
The law states that marriages or civil unions from outside the country will be void inside the country.