A television reporter in South Africa has been forced to apologise after tweeting: “it’s fine to be homophobic”.

Arabile Gumede, a business journalist with 24-hour news channel eNCA, was commenting on Ugandan President Yoweri Musevni’s decision to sign Uganda’s Anti-Homosexuality Bill into law.

The South African Times reports Mr Gumede tweeted: “I think it’s fine to be homophobic, but to imprison someone for life because of their sexual preference is quite hefty.”

He continued: “Imprisoning a homosexual for life is like killing a squirrel cause it stole your cashews.”

Power FM presenter Eusebius McKaiser tweeted in response: “Why on earth is homophobia OK dude? Is it OK to be racist as long as I don’t beat you to a pulp?”

Mr Gumede replied: “It actually is.”

Head of News at eNCA, Patrick Conroy, said: “We do not condone discrimination in any form.”

Mr Gumede has now apologised. “I would like to pass on my sincerest apologies for my tweet,” he said in a statement.

“My hope was to relay a message that no one should impose their views on others either through death or any harm no matter what their views are on any social, judicial, economic or environmental issues. I am truly sorry, and take full responsibility for my actions.”

South Africa’s post-apartheid constitution in 1997 was the first in the world to outlaw discrimination based on sexual orientation.

Officially endorsed by Nelson Mandela as president on 10 December 1996, the document allowed campaigners in South Africa to advance LGBT equality over the course of the next decade.

South Africa became the first and so far only country in Africa to legalise marriage rights for same-sex couples in 2006.