A Cape Town pastor who made homophobic comments has narrowly escaped jail time - for now.

On Friday‚ the Equality Court in Cape Town sentenced Oscar Bougardt to 30 days in jail‚ suspended for five years.

In 2014‚ the pastor - a staunch supporter of Steven Anderson‚ an anti-gay preacher from the United States - reached a settlement with the SA Human Rights Commission in the Equality Court. He undertook not to make anti-gay statements on social media and this was made an order of court.

But during an interview with News24 last year‚ he said most paedophiles have a homosexual background.

Hendrik Baird‚ the station manger of Gay SA Radio‚ wrote an open letter to Bougardt challenging his statement.

"I cannot find any statistics about paedophilia in South Africa‚ nor any statistic or reference that homosexuals account for any of the assaults. In fact‚ I only find that children were punished if they had homosexual tendencies‚” Baird wrote.

Because Bougardt made these statements‚ published on News24‚ he was found to be in contempt of the 2014 court order and this lead to Friday's ruling.

The court handed down the suspended sentence on condition that he does not breach the court order again. eNCA live-streamed the judgment.

Bougardt could not be reached for comment.