An ultra-Orthodox Israeli lawmaker resigned on Wednesday after a number of prominent rabbis demanded his party fire him for attending his gay nephew's wedding.

Shas MK Yigal Guetta told Israeli media at the beginning of the week that he attended his nephew's same-sex marriage ceremony, prompting outrage from leading Sephardic rabbis affiliated with the deeply religious party.

"[My nephew] said he wanted my blessing," Guetta told Army Radio on Sunday, "I told him I don’t understand about such things. And he told me that he's gay and that he's marrying a man. So I told him that now I understand even less.

"My entire family went to the wedding. I usually don’t tell my kids to what events they should go, but this time I told them attendance was mandatory. Beforehand, I told my kids: 'We're going to make him happy because he's my sister's son and I want him to be happy, but I want you to know that according to the Torah this [wedding] is forbidden and an abomination. I have no leeway on this."

Outrage soon followed, and a letter published on Monday by five prominent rabbis said Guetta had "publically desecrated God's will" by forcing his family to attend a wedding that "is forbidden" and is "an egregious offense." The letter demanded he be fired from his position and the reason be made public.

Source close to the lawmaker said that he had refused to apologize and decided to leave before being requested to do so by the party's Council of Torah Sages, Shas' religious leadership body.

According to people close to the Shas party, Guetta received the support of party chairman Arye Dery, who said he accepts Guetta's resignation and thinks Guetta can still play a role in the party and its affiliated movement.

A source within the party told Haaretz that it is very likely critics of Shas are using this incident to try to cause the party political harm. "The rabbis that signed off on this letter are all rabbis that did not receive support from Shas for their institutions. These rabbis didn’t even try to hear Guetta's version of the event. The person who sent them the recording of the radio interview dropped the part in which Guetta explains that it is forbidden according to religious."

Politicians from across the Israeli opposition blasted the incident, with the new leader of the Zionist Union, Avi Gabbay, saying that "Guetta lost a family member to a terror attack when he was eight and his choice to honor his sister by going to her son and his partner's wedding is humanity at its finest."

MK Dov Khanin, the sole Jewish lawmaker from the Joint Arab List party, said that it is "horrible that in 2017 attending the wedding of a gay family member can inspire such a reaction."