The next day, the police arrested Mr. Davids, 22, and another man, charging them with rape and murder.

The attack, in February, produced such revulsion and outrage that it quickly became a national symbol of the epidemic of violence against women in South Africa, much as other recent cases have forced national soul-searching on sexual violence plaguing India, Egypt and Brazil.

With the swift arrest of two suspects, hopes were high that the attack on Ms. Booysen would be prosecuted quickly. But just as the trial was about to start last week, the prosecutors made a dramatic announcement. Despite Ms. Booysen’s dying declaration, they did not have enough evidence to prosecute Mr. Davids, and he was set free.

“We understand the sense of shock and outrage that was induced by the incident,” Eric Ntabazalila, a spokesman for the National Prosecuting Authority, told reporters. “However, as the prosecution we can only prosecute successfully on sufficient evidence.”

The trial of the second suspect began Monday, but the failure of prosecutors to make a case against Mr. Davids has shaken the public’s faith in South Africa’s ability to address its rape problem and hold perpetrators accountable.

“Everybody is terribly disappointed and feels incredibly let down,” said Rachel Jewkes, an expert on violence against women at the South African Medical Research Council. “The question is, did the police really go all out to investigate?”

About 64,000 cases of sexual assault are reported here each year, and South Africa has one of the highest rates of nonpartner rapes in the world. But studies show that number vastly understates the epidemic, suggesting that hundreds of thousands of cases are not reported. Of those that are, fewer than 10 percent result in convictions, a product, analysts say, of shoddy police work and ineffective prosecution by a criminal justice system that has largely failed to take crime against women seriously.

The dismal conviction rate leaves victims feeling helpless, Ms. Jewkes said.

“Many women wonder why they should bother to report,” she said.

Like many others in Bredasdorp, a dusty, remote farming town about 100 miles southeast of Cape Town, Ms. Booysen had a difficult childhood. Her mother died when she was young, and she was passed between relatives and bounced in and out of foster homes, relatives and neighbors said.

She dropped out of high school, and like many young people here, where jobs are hard to come by but alcohol and drugs are omnipresent, she spent her days idly drinking cheap beer and wine with friends. The day she was attacked was no different.

On the afternoon of Feb. 1, Ms. Booysen was at a neighborhood bar, witnesses said. So was Mr. Davids, though the two had not arrived together, and were not seen drinking together, the witnesses said. Another young man, Johannes Kana, was also there.

Early the next morning, Ms. Booysen was found at a construction site near her house, bleeding and near death. She was taken to the hospital but died that day.

What happened after she left the bar is disputed. In an interview, Mr. Davids said that he saw Ms. Booysen at the bar, but did not drink with her, did not know the people she was with and did not see when she left. He said he left the bar to continue drinking at a friend’s house. Mr. Kana admitted raping Ms. Booysen, according to the government, but denies killing her. He has been charged with rape and murder and is now the only suspect on trial.

The National Prosecuting Authority did not respond to multiple requests for comment in the case.

Ms. Booysen’s rape and murder brought a furious response. The singer Annie Lennox led a protest march in Cape Town. A radio station played a chime every four minutes as a reminder to listeners of how often a woman is raped in South Africa. Politicians gave speeches expressing shock and promising tough new actions to protect women and girls from predators.

“The whole nation is outraged at this extreme violation and destruction of a young human life,” President Jacob Zuma said in a statement. “This act is shocking, cruel and most inhumane. It has no place in our country. We must never allow ourselves to get used to these acts of base criminality to our women and children.”

Despite the protestations of politicians, such crimes are neither new nor uncommon. A 2009 study by the Medical Research Council found that one-quarter of men admitted to raping someone, and nearly half of those men said they had raped more than once.

One research study on a small town in Mpumalanga Province examined about 250 reported rapes from 2005 to 2007. More than half of the victims were minors. Arrests were made in 60 percent of the cases, but more than two-thirds of those cases were dropped and never came to trial. Ultimately only nine of the accused were convicted, and only seven received jail sentences. Several men were suspects in five or six different rape cases. None of those cases ever made it to court, the study found.

Analysts point to the history and culture of South Africa, a deeply patriarchal society that devalues crimes against women and where 19 years after the end of apartheid the criminal justice system is still struggling to transform itself from a security force aimed mainly at protecting the white minority into a professional crime-fighting organization.

The police do not take rape allegations seriously and fail to perform basic detective work, like collecting forensic evidence, said Lisa Vetten, a researcher who worked on the Mpumalanga study. Victims are intimidated by perpetrators, who are quickly released on bail. Prosecutors shy away from taking tough cases, especially those where physical evidence is not available.

In some cases, appellate court judges set aside guilty verdicts because they simply do not believe the victim. Two young men in Limpopo Province were convicted of raping a 17-year-old girl in the bushes near her home in 2007. The girl had been walking to a public telephone when the two men waylaid her, forced her into the bushes and took turns assaulting her, according to the appeals court record.

But in 2012, an appellate court judge set aside the conviction because her account of the assault “has some defects which cannot be ignored.” The victim had failed to run away or scream to passers-by, the judge said. She made up the story about being raped, the judge reasoned, to explain the bleeding from the loss of her virginity.

“It is fascinating that a judge would believe that a girl would wish to have her first sexual experience with two men she never met in a bush,” Ms. Vetten said. “The judge simply decided, without any real evidence to support it, that she made it up.”

As to Ms. Booysen’s dying testimony pointing to Mr. Davids, the prosecution has offered no further public explanation as to why the case against him was dropped.

Mr. Davids, glassy-eyed and reeking of alcohol in the middle of a recent afternoon, was smoking marijuana and fuming about the case. He seemed to regret what happened to Ms. Booysen, who he said was “like a sister” to him, and insisted he had nothing to do with the crime.

What was bothering him was that he spent four months in jail as a suspect, which he found devastating.

“I have nothing left inside me to feel,” he said. “My pain is so deep I can’t go any further.”

Mukelwa Hlatshwayo contributed reporting.