ANKARA - Turkish authorities on Monday launched an investigation into the Ankara bar association after lawyers lambasted the chief of the country's top religious body over his remarks on homosexuality.

Ali Erbas, head of the institution known as Diyanet, sparked controversy on Friday when he said homosexuality caused disease. Ruling party officials on Monday defended him after bar associations at the weekend accused him of provoking hate.

Erbas said that Islam "condemns homosexuality (which causes) diseases and corrupts generations" as he claimed it led to human immunodeficiency virus (HIV), the virus that causes AIDS.

He also said fornication "is one of the biggest sins in Islam" during the weekly sermon, the first of the Muslim fasting month of Ramadan.

In a statement on Sunday, the Ankara bar association accused Erbas of "inciting hatred and hostility" while ignoring child sexual abuse and misogyny.

"It shouldn't surprise anyone if in his next speech he invites people to burn women in the squares with torches in their hands because they are witches," it added.

The Ankara public prosecutor's office then opened a probe into the association for "insulting the religious values adopted by a section of society".

Erbas also made a criminal complaint against the bar association on Monday.

Two of the most trending topics on Twitter on Monday were #AliErbasYalnizDegildir (Ali Erbas is not alone in Turkish) and #LGBTHaklariInsanHaklaridir (LGBT rights are human rights).

One of those who used the hashtag was President Recep Tayyip Erdogan's spokesman, Ibrahim Kalin, who tweeted: "Ali Erbas, who voiced divine judgement, is not alone."

And the spokesman for Erdogan's ruling Islamic-rooted party, Omer Celik, insisted that Erbas's comments "should be respected according to democratic values" on Twitter.

"Everyone has the fundamental right to speak in Turkey based on whatever value system they believe in," Celik said.

Diyanet is a state-funded institution established in 1924 to oversee religion in modern secular Turkey after the abolition of the Islamic Caliphate in the wake of the Ottoman Empire's collapse.

Although homosexuality has been legal throughout modern Turkey's history, LGBTI individuals face regular harassment and abuse.

In recent years, LGBTI events have been blocked including Istanbul Pride, which has been banned five years in a row after taking place every year since 2003.