A lawmaker from the ultra-Orthodox Shas party resigned on Wednesday after coming under fire from rabbis, who criticized him for attending his nephew’s gay wedding.

Yigal Guetta informed Shas leader and Interior Minister Aryeh Deri he would give up his Knesset seat. Deri thanked Guetta and said there would be other roles in which he could serve in the party.

“Minister Deri told MK Guetta that he respects his decision, expressed his appreciation for him and thanked him for his valuable work and for the new and energetic spirit he introduced to Shas,” a letter from Deri’s office said.

His resignation came a day after rabbis published a letter railing at Guetta‘s “public desecration of Heaven” and demanded that the leaders of Shas “remove and fire” him “immediately.”