Zsolt Borkai, the mayor of Gyor, the largest city in western Hungary, who easily won reelection to a fourth term last month despite a video made public showing him participating in an orgy on a luxury yacht, will step down from his position on Friday because of his “moral predicament”.

Bloomberg News reports that the 1988 Seoul Olympics gold medal gymnast resigned earlier from Prime Minister Viktor Orban’s ruling Fidesz party after opposition had seized on the Borkai scandal during the campaign for nationwide municipal elections as evidence of moral decay under Orban’s nine-year rule.

The video is said to show Borkai and multiple others having sex in what has been described as an “orgy” on a yacht in the Adriatic Sea. The former chairman of Hungary’s Olympic Committee described the incident as a private yacht trip with friends and has not denied he had sex with a young woman, but wrote in a publicly released resignation letter that other allegations against him in connection with the trip were “a bunch of lies”, according to Reuters.

The video was released just days before municipal elections across Hungary and is said to have factored in surprise losses for Fidesz, the worst in a decade.