A South African rabbi was jailed and resigned from his synagogue after attempting to blackmail another rabbi.

Cape Town Rabbi Bryan Opert stepped down from the Milnerton Hebrew Congregation after trying to blackmail Rabbi Ruben Suiza, the longtime head of the city’s Sephardic community, the Haaretz newspaper reported. Opert was jailed for 48 hours in a case that came to light in late April and was first covered in the Afrikaans-language newspaper Rapport.

Opert, who approached Suiza anonymously via emails to Suiza’s wife, threatened to make public that the rabbi had been consorting with prostitutes if Suiza did not pay 48,000 South African rands, approximately $4,430.

The charges against Opert, who also is the administrative head of conversions at the Union of Orthodox Synagogues, have been suspended in an agreement with the Suizas as they continue talks with the authorities, according to Haaretz.

In a letter to his congregation, Opert blamed his behavior on a struggle with depression.