The decision by the national police commissioner to remove the investigator, Hilton Botha, was the latest in a series of abrupt twists and setbacks in the prosecution of Mr. Pistorius, the double amputee track star accused of killing his girlfriend. It caused a further delay in the defendant’s hearing on his request to go free on bail in the case that has riveted South Africa and much of the world.
The commissioner, Riah Phiyega, said Mr. Botha would be relieved by Lt. Gen Vinesh Moonoo, whom Ms. Phiyega described as the country’s “top detective,” The Associated Press reported.
The attempted-murder accusations hanging over Mr. Botha only compounded questions about his work on the Pistorius case. Under cross-examination on Wednesday, Mr. Botha was forced to acknowledge sloppy police work and to concede that he could not rule out Mr. Pistorius’s version of events in the shooting death of his girlfriend based on the existing evidence.
“The poor quality of evidence presented by chief investigating officer Botha exposed the disastrous shortcomings in the state’s case,” Mr. Pistorius’s defense lawyer, Barry Roux, said on Thursday.
The courtroom itself became part of the drama on Thursday when the magistrate hearing the case ordered an abrupt and brief suspension because of an unexplained “threat to the court.” The case was later adjourned until Friday.
While the prosecution has accused Mr. Pistorius, 26, of premeditated murder in the killing, Mr. Pistorius has said he opened fire through a locked bathroom door thinking there was an intruder in his home in a gated community and had no intention of killing his girlfriend, Reeva Steenkamp, 29, a model and law-school graduate.
When the bail hearing resumed on Thursday — Mr. Pistorius’s fourth court appearance since the shooting on Feb. 14 — the chief prosecutor, Gerrie Nel, began by acknowledging the attempted murder charges against Mr. Botha, but said prosecutors did not realize that the case had been reinstated when Mr. Botha testified against Mr. Pistorius on Wednesday.
Mr. Nel went on to assail Mr. Pistorius’s defense of his actions in the early hours of Thursday one week ago, when, the athlete has said, he did not realize Ms. Steenkamp was no longer in bed as he rose to investigate the supposed intruder, shouting to her to call the police.
“You want to protect her, but you don’t even look at her. You don’t even ask: Reeva, are you all right?” Mr. Nel said. “His version is so improbable.”
Earlier, the hearing dwelt for some time on the absence of urine from Ms. Steenkamp’s bladder when she died, consistent, the defense said, with the suggestion that she simply went to the toilet rather than fled from Mr. Pistorius after an argument as the prosecution asserts.
Mr. Roux, the defense lawyer, said she may have locked the toilet door after hearing Mr. Pistorius call out that an intruder was in the house.
The case has continued to take a toll on Mr. Pistorius’s global reputation as an emblem of athletic prowess and of triumph over adversity. On Thursday, Nike became the latest corporate sponsor to suspend ties with him. “We believe Oscar Pistorius should be afforded due process, and we will continue to monitor the situation closely,” the company said in a statement on its Web site.
Here in Pretoria, in a development that seemed as bewildering as it was sensational on Thursday, a police brigadier, Neville Malila, said earlier that Detective Botha was set to appear in court in May facing attempted murder charges relating to an episode in October 2011, when Mr. Botha and two other police officers were accused of firing at a minivan carrying seven people.
“Botha and two other policemen allegedly tried to stop a minibus taxi with seven people. They fired shots,” Brigadier Malila said.
South African news reports said the 2011 shooting happened when the officers were pursuing a man accused of killing and dismembering a woman.
Medupe Simasiku, a spokesman for the National Prosecuting Authority, said “the decision to reinstate was taken on Feb. 4, way before the issue of Pistorius” or the shooting death of Ms. Steenkamp “came to light.”
“It’s completely unrelated to this trial,” the spokesman said.
Mr. Botha was quoted in South African news reports as denying claims that he was drunk during the episode in question. He said he and other officers had aimed at the wheels of the minivan without causing injuries and he was convinced that the case had been withdrawn.
The Pistorius case has riveted South Africa and fascinated a wider audience, reflecting Mr. Pistorius’s status as one of the world’s most renowned athletes, whose distinctive carbon-fiber running blades inspired the nickname Blade Runner.
He was born without fibula bones in both legs and underwent amputation before he was one year old. Yet he went on to become a global Paralympic champion and the first Paralympic sprinter to compete against able-bodied runners in the 2012 London Olympics.
The questions surrounding Detective Botha surfaced on Wednesday after he explained how preliminary ballistic evidence supported the prosecution’s assertion that Mr. Pistorius had been wearing prosthetic legs when he shot at a locked bathroom door early on Feb. 14. Ms. Steenkamp wasbehind it at the time.
Mr. Pistorius said in an affidavit read to the court on Tuesday that he had hobbled over from bed on his stumps and had felt extremely vulnerable to a possible intruder as a result.
Lydia Polgreen reported from Pretoria, South Africa, and Alan Cowell from London.