Malusi Gigaba's sex tape has appeared on the world's biggest porn site. Image: Robert Tshabalala

South Africa’s Home Affairs Minister Malusi Gigaba, has resigned following a leaked sex tape in which he was seen playing with his manhood.

Mr Gigaba has been under pressure to quit his cabinet position following a court ruling that he lied under oath, thus violating the constitution.

A South African court ruled last December that Gigaba had violated the constitution when he denied having ever approved an application by the Oppenheimers to operate an immigration service for wealthy VIPs at Johannesburg’s main airport.

Public Protector Busisiwe Mkhwebane had given President Cyril Ramaphosa until Wednesday to take disciplinary action against his minister.

Mr Gigaba wrote his resignation letter to President Ramaphosa on Tuesday, saying he had chosen to place the interests of the ruling African National Congress (ANC) and the country above his personal interests.

The minister had last month issued a public apology after his nude video was leaked online.

In his apology, he admitted to having filmed the video for private consumption, but that he lost control of it to hackers, whom he said have been using it to blackmail him since last year.

He revealed that the video was stolen when his cellphone was hacked in 2016/2017.

The 13-second video shows the minister playing with his genitals while saying some graphic words.

“I hope our nation will, someday, constructively engage with the question of whether it is correct to condone and promote the gross invasion of the privacy of others by distributing such material, more especially in the clear absence of a public interest justification,” he had said in his apology.