Four South African men have been sentenced to 18 years in jail for stabbing and stoning to death 19-year-old lesbian Zoliswa Nkonyana in 2006.
The court found that the men killed Ms Nkonyana because she was living openly as a lesbian.
A crowd outside the court in Khayelitsha, a Cape Town township, cheered and danced at the sentencing.
The constitution protects people on the grounds of sexual orientation – but homophobia is widespread.
The BBC’s Pumza Fihlani in Johannesburg says the sentence handed out in the Nkonyana case is highly significant – both because of its length and the fact that the magistrate concluded that Ms Nkonyana was killed for being a lesbian.
For years activists have been calling on the state to be tougher on people who kill or attack people because of their sexual orientation – and they want the state to recognise hate crimes against lesbians, she says.
Lubabalo Ntlabathi, Sicelo Mase, Luyanda Londzi and Mbulelo Damba – who were convicted in October – were each given 18 years.
Five other people were acquitted.
The family of Ms Nkonyana welcomed the sentence.
“They did not accept responsibility for what they did and we are happy that when we asked for a lengthy jail term, the magistrate agreed to that,” stepfather Mr Mandini told South Africa’s Sowetan newspaper.
Ms Nkonyana was stoned and stabbed nine times in February 2006, just metres from her home in Khayelitsha.
The magistrate said it was clear the motive for the killing was hatred and homophobia – and Wednesday’s sentence was meant to send out a signal that violence based on sexual orientation will not be tolerated, the South African Press Association reports.
Jill Henderson from the Triangle Project – a non-governmental organisation that fights for the rights of gay and lesbian people in Khayelitsha – said this was a good move.
“The magistrate has named hate and intolerance on the basis of sexual hate and intolerance on the basis of sexual orientation as an aggravating factor in sentencing- tat is the first time that has happened in a criminal trial in South Africa. It has therefore set a precedent,” she told the BBC’s Focus on Africa programme.
In December, the global rights group Human Rights Watch said in a report that South Africa is “desperately failing lesbian and transgender people” – despite the country’s liberal laws.
South Africa is the only African country where same-sex marriage is allowed.
But violence against gay and lesbian people is common, particularly in black communities, our correspondent says.
Lesbians are often subjected to “corrective rape” by men who think this will “cure” them of their homosexuality.
Three years ago, a man was sentenced to life in prison and another to 32 years for the gang rape, robbery and murder of Eudy Simelane, a lesbian activist who had been a midfielder on the national football team.
Last year, a man was sentenced to 15 years in prison for the rape and murder of Nqobile Khumalo, a lesbian in Durban.