Despite the angry protests of a Cape High Court judge, a Cape Town advocate announced in court that a gay Elsies River hairdresser was responsible for his own murder because he "liked being sodomised".

Advocate Sheriff Mohammed is appearing for a member of a group who sodomised and then killed Ivan Johannes in June 2001.

During his defence of Johannes Haas, 19, Mohammed referred to the dead man variously as a "moffie", a "bunny" and a "catamite", while his legal colleagues, journalists and people in the gallery cringed in their seats.

Mohammed was briefed by the Legal Aid Board to appear for Haas, who was convicted with Isaac Jonathan, 30, and Terence Gentle, 19, of murdering Johannes.

The hairdresser was stabbed and crushed to near-death after two cement blocks were repeatedly dropped on to his head and chest, then set alight.

All three convicted men were jailed for an effective 25 years by Judge Dennis Davis on Wednesday.

Mohammed is also the advocate who has been briefed to defend Lyanda Mboniswa, 21, the security guard charged with killing former first lady Marike de Klerk. Mboniswa's trial will start on August 5.

Judge Davis said in court on Wednesday: "We must protect victims. We must take them as seriously as criminals."

In his closing argument on Wednesday, Mohammed attempted to show that Johannes was responsible for some of the moral blameworthiness of the attack on him.

"The deceased allowed himself and his body to be used..." Mohammed began. But he was sharply interrupted by Judge Davis, who said: "Don't go down that road."

Mohammed: "But he was a... what do you call it... a catamite, my lord."

To increasingly outraged interruptions from the judge, Mohammed said Johannes had "liked to be sodomised".

"If this did not happen, would he have been killed?" Mohammed demanded, slamming a book closed and staring at the judge.

Judge Davis: "I am not prepared to consider this."

Mohammed then launched into an explanation on how society had not developed with the Constitution, suggesting that society might not be as accepting of gay people as the court clearly was.

Judge Davis said: "I will note your argument."

The court heard evidence that in June last year after having drinks, Jonathan, Haas, Gentle and three other men took Johannes to a derelict building in Elsies River, where at least some of them had sex with him.

They were charged with indecent assault, but discharged on this count.

When Johannes said he wanted to leave, the men would not let him go, saying he would go to the police.

Johannes was pushed down a flight of steps and kicked. Jonathan assaulted him with a belt and he fell on the floor below the stairs, where cement blocks were repeatedly dropped on his head and chest by Haas and Gentle. While he was still alive his body was set alight by Gentle.

The three men were convicted on the basis that they had a common purpose to kill Johannes.

Sentencing the men, Judge Davis said Jonathan had not been as involved in the murder as Haas and Gentle.

The murder had been very brutal and the attack had lasted for some time. "This night of darkness ended when Gentle set fire to Johannes while he was still alive."

Judge Davis found that there were substantial and compelling circumstances not to send the three men to prison for life, but that these circumstances did not warrant him imposing a sentence much less than life.

He sentenced all three men to 25 years' imprisonment for the murder and ordered that a sentence of three years for kidnapping run concurrently.

Allan Lange appeared for Jonathan and Russell Horne for Gentle.