Judge Thokozile Masipa, a black former journalist once arrested and thrown in prison for taking part in a protest, gazed across the courtroom at witness Tom Wolmarans, a white ex-policeman. Thirty years ago they were on opposite sides of the violent political divide. Today, she embodied the majesty of the law and he addressed her as "Ma'am".  This was just one of the historical intrigues in the trial of Oscar Pistorius for the murder of Reeva Steenkamp. Before the eyes of millions, a Zulu judge raised in a township presided over two Afrikaner lawyers and a wealthy Afrikaner accused. None was speaking their first language, since South African court hearings are conducted in English. At the end of each day, family members, expert witnesses and lawyers would file out of the wood-panelled courtroom in Pretoria and cleaning staff would file in, a crossroads of class and race.  South Africa itself has been on trial over the past six months. The world has been told of police bungling and dishonesty but been given a rather more flattering picture of the judicial system. It has tried to decide whether this is a case of domestic violence or fear of residential crime – twin demons that torment South Africa. It has seen how much has changed in this country since the end of racial apartheid in 1994, and how much has stayed the same.  "What is playing out in the North Gauteng high court is more than just a murder trial," wrote Mondli Makhanya, a columnist at City Press newspaper. "It is South Africa holding up a mirror to herself."  The notion that Masipa, who began studying law during apartheid and became only the second black woman appointed to the high court, is holding 27-year-old Pistorius's fate in her hands would once have been unthinkable. Nomavenda Mathiane, a former newspaper colleague, said: "It's such a great thing to see this woman from the dusty streets of the township standing in judgment over this young white man who had it all. It makes me proud and I tell my children that anyone can make it with determination."  From a very different starting point, Wolmarans did national service for the apartheid government, became a police ballistics expert and also worked for Ian Smith's regime in what is now Zimbabwe. He left the country the day that Robert Mugabe became leader of a black government. "I've never been racist," Wolmarans, 68, said in a recent interview. "I worked for the state but I've always been objective in my career. I've always given the benefit of the doubt, whether it was to a black man or a white man."  Wolmarans recalled a case in the late apartheid years in which he gave evidence that led to the acquittal of a black man accused of killing his girlfriend. He added: "I've experienced black judges who are brilliant and white judges who are brilliant, and both who are not so brilliant. I've got no problem at all with black judges."  Over 41 court days, justice in South Africa was under scrutiny as never before. The police's reputation took a hammering as Pistorius's lawyers exposed flaws in their investigation, contamination of evidence and even the apparent theft of the athlete's designer watches. This indictment came against a backdrop of nationwide concerns over police brutality and criminality that peaked in the 2012 massacre of 34 striking mineworkers in Marikana.  Johan Burger, a former police officer and now a senior researcher at the Institute for Security Studies in Pretoria, said: "It was a very bad performance by the police. I know there are many good police people and very dedicated investigators, but what happened there is absolutely shameful and I think it did a lot of damage to the image of the police, especially because people internationally started showing huge interest.  "It showed the worst of the police, and as a former policeman that was a huge embarrassment to me to see these things being admitted, and the police being accused of stealing stuff. Not just a shoddy investigation, not just a shoddy way of dealing with a crime scene, but actually stealing stuff, which is criminal. That is beyond any excuse."  For many, however, there was redemption in the way South Africa defied outsiders' expectations of a kangaroo court. In the austere setting with its rules and rituals, prosecutor Gerrie Nel and defence counsel Barry Roux gave the 37 witnesses no quarter, not least Pistorius himself, whose celebrity and wealth meant nothing against Nel's fierce onslaught. But above all there was Masipa, a red-robed figure of quiet dignity and gravitas who kept both lawyers in check and strove for a fair trial.  She remained inscrutable as the court heard how Pistorius allegedly reacted angrily to a police officer who pulled him over, and fired a gun into the air. Mark Gevisser, a South African author and journalist, said: "There were two images being projected. One was of a society, and a section of society, that is violent, self-obsessed and contemptuous of the law. It was a lawlessness that represents a certain kind of South African impulse, not just an Afrikaner impulse.  "In contrast to that there was a cool, rational, empathetic, thoughtful court headed by a black woman. She was so neutral in the right way. For most people watching, her race became irrelevant from early on because she was so professional."  But when Gevisser did consider her race, he was proud. "I Googled her and saw her history under apartheid and thought, 'How incredible.' I'm often looking for indices of change in our society. This was a reminder to me how far we've come in 20 years."  Critics pointed out, however, that while Pistorius's riches and the high profile of the case ensured the world saw South African justice at its best, it was not representative of the incompetence and long delays that often plague the trial of an accused from a township.  The court heard from a procession of witnesses, including middle-class professionals who lived in Pistorius's gated community, a less savoury crowd he socialised with, and experts with thinning hair and widening girth. Nearly all were white. So were most of the attorneys and junior counsels, and most of the pundits filling hours of commentary.  Makhanya wrote: "Oh, but there were some blacks who have played a role in this trial. There was the security guard from Pistorius's complex. There have also been the interpreters and court orderlies. And yes, there is judge Thokozile Masipa and her assessors, the most senior people in the court. But the fact they are drops in an ocean of whiteness is something that should disturb South Africans in this 20th year of our democracy."  One more black person haunted the trial. When Pistorius claimed he mistook Steenkamp for an intruder, shooting four times, he was tapping into the paranoid imagination of suburban South Africa, the long-honed fear of an armed and dangerous black intruder, according to the crime novelist Margie Orford. "That fear of crime is a deeply racialised pathology in South Africa," she said. "What was very interesting to me was Pistorius's extremely experienced lawyer seemed to be caught with the idea that the imaginary intruder, that mythic danger, would excuse all behaviour."  Most victims of murder in South Africa are young black men in poor areas, not the high-security gated communities where Pistorius lived. Orford added: "The bogeyman is like a vampire. As soon as you put the light on it, it disappears. What we saw is how much time is spent fearing something that does not exist. Yes, there is crime, yes, there is murder, but it is in a specific place and in specific ways."  The women's league of the African National Congress has been a constant presence in the public gallery at the high court. South Africa has one of the highest rates of intimate partner homicide in the world. In 2009 it was estimated that a woman was killed by her husband or boyfriend every eight hours – more commonly than by strangers.  A fifth-generation Afrikaner, Pistorius has a historical context of his own. Afrikaners are descended from predominantly Dutch settlers who arrived in the Cape in the 17th and 18th centuries. They carved out a distinct identity around the Afrikaans language, Calvinist religion and a frontier spirit. Declaring independence from the British empire, they loaded up ox-wagons and trekked north into the interior, creating the Boer republics, fighting a war and founding a mythology. By the mid-20th century, there was an Afrikaner government with a policy of apartheid.  Burger said: "Afrikaners have always seen themselves as fighting for survival as a group since the days when Jan van Riebeeck came here in 1652. Then there was the groot trek [great trek] because the English wanted to dominate and take away the language and other cultural things very important to the Afrikaner. After the Anglo-Boer war, when the Afrikaner community started to establish themselves, they always faced the threat of a black majority and they had to devise ways and means to survive and the only way they saw fit at the time was through this whole policy of keeping people apart."  Guns, fear of God, patriarchy, self-sufficiency and social conservatism are all stereotypes that certainly do not apply to all Afrikaners today, but which seem to find resonance in Pistorius. "He constructed a narrative of triumph over adversity through Afrikaner Calvinist hard work," Gevisser observed.  The court heard about the athlete's obsession with firearms: he had placed an order for three shotguns, two revolvers and a rifle at the time he killed Steenkamp. He also spoke passionately about the Christian faith that has sustained both him and his family. A tattoo on his left shoulder quotes a Bible verse from Corinthians that begins: "I do not run like a man running aimlessly".  Then there was the sense of rugged individualism because central authority cannot be relied upon. Giving evidence during the trial, Pistorius recalled: "My family have always believed in standing up for yourself and standing up for what you believe in. I come from a family where we were taught that we don't cry to our parents at the end of the day. I remember a situation where my buttons got torn off my shirt and my mother sent me to school the next day and said to me if my shirt came back that way the next day, I should send it home with the other kids' parents, and it happened the next day and I got called into the headmaster's office.  "I stood up for myself and I got into a physical altercation with this other kid. When I got called in my mother arrived and she just basically said to the headmaster that she doesn't think it's wrong for her kids to stand up for what they believe in, and for getting bullied, and she wouldn't be back, and she gave the shirt to the kids' parents and told them to bring it back when it was repaired."  Afrikaners now make up about 5% of the South African population. Some believe Afrikaner culture, language and identity are under threat and point to the relatively high murder rate of farmers. A small minority of hardliners never stopped regarding Nelson Mandela as a terrorist and fear that his death last year could trigger racial conflagration. Some are said to have undergone military training to defend themselves and stockpiled cans of food in bunkers.  Gevisser said: "During the trial I thought a lot about frontiers and the laager [an encampment formed by a circle of wagons]. I asked myself, the question how many countries in the world would it even be considered to be self-defence to shoot through a locked door? It says something about a certain white South African consciousness of siege and frontier that goes beyond not having legs."  More recently in South African history there was the armed struggle for and against apartheid. The country was awash with guns in both black and white hands. Nel said during the trial that he understood Pistorius's family owned 50 or more guns. The Paralympian testified that his mother kept a pistol under her pillow when he was a child. "I think everybody in South Africa's been exposed to crime at some point," he said. "We had many house break-ins when I was growing up."  Burger added: "We all grew up with guns and remember we came through a period before 1994 where we were all trained, whites and blacks in this country, in the handling of military firearms … Apart from that, South Africa became a very violent society, especially in the 1980s. There were mass murders in this country, political violence, young children under 10 dancing around, burning adults and it was just incredible to see, and this is what they grew up with.  "Violence became ingrained. South Africa became a very militarised, violent society in the 1980s, and this is why I think many people saw 1994 as a miracle. Whether the miracle still lives on is a debatable issue. At the time, the miracle was that most of us thought South Africa was going up in flames. Guns became part of the lives of everybody in this country."  But post-apartheid legislation meant that many guns were handed in. The international weapons-monitoring organisation GunPolicy estimates that there are now about 6m guns, or 12 for every 100 people in South Africa. "I only have one handgun," Burger said. "I hold on to it more for sentimental reasons than anything."  But some commentators reject Makhanya's idea that the Pistorius trial held up a mirror to South African society. Was that, after all, less interesting than this unique story about an individual psychological disaster? Jonny Steinberg, an author and academic, said: "What struck me about the trial was how faint the historical resonances were. That the judge was a black woman, the accused a white man, was not the defining issue. In some ways we've moved on and 20 years really is a long time."  When the court adjourned each day, however, the demographics were insistent. The job of tidying away discarded coffee cups and crisp packets, vacuuming the carpet and dusting the totemic bullet-pierced door fell to uniformed cleaners, all of whom were black. Among them was Mapula Mawasha, a 52-year-old grandmother commuting from a township. Her view of Pistorius was clear. "The Bible says you must not kill," she said.
Court case in which black judge will decide the fate of white man shines light on how far the country has come since apartheid