Byron Butler had been a magistrate for 30 years
A magistrate facing disciplinary action for comparing gay men to paedophiles in a television documentary has resigned.
Byron Butler, 68, a former Deputy Lord Lieutenant for Mid Glamorgan, made the comments during a programme hosted by former Steps singer Ian "H" Watkins.
The retired butcher agreed to stop hearing cases in Bridgend while the investigation was carried out.
The Office for Judicial Complaints said he had offered his resignation "thereby pre-empting any further action".
Mr Butler was being investigated after a complaint about his remarks in the BBC Wales Week In Week Out programme broadcast in March last year.
The programme looked at changing attitudes to homosexuality, and featured Watkins returning to his home area of Cwmparc.
Watkins, a former Celebrity Big Brother contestant, spoke about his life growing up gay in the Welsh valleys, which he called "a complete nightmare".
Ian 'H' Watkins was 'dumbfounded' by Mr Butler's comments
One of the people he interviewed was Mr Butler, who had been a magistrate for 30 years and, as a former deputy lord lieutenant for Mid Glamorgan, would have deputised for the Queen's official representative in the county.
When Mr Butler was asked for his views on homosexuality, he replied: "We haven't got much time for them."
He continued: "Well, I think probably it's a suspicion of the mainstream that they perhaps will interfere with young people and so on and that's historically been the case. That is the danger.
"Paedophiles, solidophiles [sic], not necessarily, but they do, don't they. That's the reality."
Following the remarks by Mr Butler, the singer called for him to be stripped of his JP's role and an inquiry was launched by the Office for Judicial Complaints the following month.
A spokesman for the office said Mr Butler stood down before Christmas last year, in the "early stages" of the inquiry.
In a statement, the spokesman said: "Mr Butler has resigned during the course of the disciplinary proceedings against him, thereby pre-empting any further action.
"The Lord Chancellor and Lord Chief Justice have accepted his resignation and he will no longer sit as a magistrate."