A 17-year-old girl, who handed herself in to South African police, has been charged with murder after killing a man who allegedly tried to rape her.
"She was on her way to a local tavern when she was allegedly attacked by the deceased and fought back," police said.
The young woman stabbed the 21-year-old man, after overpowering him during a struggle, police say.
South Africa has one of the highest incidences of rape in the world.
There has been a recent spate of killings of women in the country, which has sparked national outrage.
The girl was not asked to plead when she appeared in the Lenyenye magistrates court in the northern Limpopo province.
The suspect, who is a minor under South African law and cannot be named, would be assigned a social worker and possibly a trauma counsellor to assist with the case, according to the police.
"She was visibly distraught when she arrived at the police station and will receive the necessary care given in such cases," police colonel Moatshe Ngoepe told the BBC.
She is expected to tell the court that she acted in self-defence, when the case resumes on 14 June.
Was killing the only option? By Pumza Fihlani, BBC News, Johannesburg
Pleas of self-defence must pass a high legal threshold to be accepted by South African courts.
The defendant must prove that there were extenuating circumstances involved and that killing was the only option available at the time.
The country's laws on self-defence have faced criticism in the past, with some legal analysts saying the law should offer more support to those forced to fight off attacks in a society with a high crime rate.
But some legal scholars have argued it is precisely because of this high crime rate that people should not be able to kill others with impunity and self-defence pleas should face high hurdles.
Legal expert Mannie Wits says that when looking at a self-defence plea, the court broadly uses the test of "what the reasonable man or woman would do in a similar situation".
But he points out that in the South African context, this is becoming increasingly problematic as levels of violence have increased.
"The test of what a reasonable man in the UK would do in a similar situation to a man is South Africa is not the same. South Africans are living under fear, they overreact. This is not a normal society," he says.