Magistrate Desmond Nair announced the decision after hearing impassioned final arguments from the defense and the prosecution in Courtroom C of the Pretoria Magistrates Court in the presence of an emotional Pistorius, who has testified that he mistook his girlfriend, Reeva Steenkamp, for an intruder and never intended to kill her.
Nair said Pistorius did not represent a flight risk, and was not likely to interfere with state witnesses.
"The accused has made a case to be released on bail," the magistrate concluded. Pistorius family members in the packed courtroom shouted, "Yes!"
The magistrate set bail at 1 million rand (about $112,000).
Before announcing his ruling, the magistrate reprised the four days of conflicting arguments by defense and prosecution lawyers. Pistorius' shoulders shook with emotion and tears fell from his eyes as, at one point, Nair said, "The deceased died in his arms."
Nair said bail was not a matter of guilt and innocence, but about determining whether justice would be served by holding a defendant in custody.
But he took issue with the testimony and actions of the prosecution's lead investigator, Detective Warrant Officer Hilton Botha, who has since been removed from the case, saying the officer committed "several errors and concessions" and "blundered" in gathering evidence.
"It is his evidence that may have been tarnished by cross-examination, not the state case," he said. At the same time, the state case was not so "strong and watertight" that Pistorius "must come to the conclusion that he has to flee."
In a two-hour summary of the case and of the laws governing bail, the magistrate also read a series of character references from friends of the athlete, who described his relationship with Steenkamp, a 29-year-old model and law school graduate, as loving and happy.
The prosecution had opposed the sprinter's application to be released on bail until a full trial, arguing that he might flee. It said Pistorius, 26, murdered Steenkamp when he fired four shots through a locked bathroom door at his home in a gated community in Pretoria on Feb. 14 while she was on the other side.
The sprinter, who underwent double amputation as an infant after being born without fibula bones and uses prostheses, has said he believed the person in the bathroom was an intruder.
Nair said that while the prosecution case rested on "nothing more than circumstantial evidence," there were "improbabilities that need to be explored" in Pistorius' account of events.
"The only person who knows what happened there is the accused," he said. But "I cannot find that it has been established that the accused is a flight risk."
He cited legal requirements that the defense must establish "exceptional circumstances" to qualify for bail in cases of premeditated murder.
Premeditated murder is the most serious murder charge under South African criminal law and carries a mandatory life sentence, with parole in 25 years at the latest.
Pistorius' lawyer, Barry Roux, said Friday that if he were prosecuting the case, the charge would be culpable homicide - a less serious charge implying either negligence or a lack of intention to kill. Prosecutors say judges decide the sentence for culpable homicide depending on the circumstances.
With his head bowed as he entered the court Friday in advance of the ruling, Pistorius appeared to be struggling to hold back tears, his jaw clenched, as the prosecutor described Steenkamp's plight on Feb. 14.
"I am not saying the planning of the murder of Reeva Steenkamp happened weeks ahead, days ahead," said the prosecutor, Gerrie Nel. "I am saying the planning to kill Reeva Steenkamp happened that night."
Steenkamp took refuge in the bathroom to escape either a fight or a gun, he said.
But Nair seemed skeptical Friday about the risk of flight by Pistorius.
"What kind of life would he lead, a person who has to use prostheses, if he has to flee" and found himself "ducking and diving every day" on artificial limbs, the magistrate asked. "His international career would be over in any event."
"A life not in prison," Nel replied, comparing Pistorius to the WikiLeaks founder Julian Assange who has taken refuge in the Ecuadorean Embassy in London, despite his "famous face."
Piling on emotional pressure Friday, Nel linked the death of Steenkamp to other violence against women in South Africa, including the case of Anene Booysen, a 17-year-old who was raped and murdered in the Cape region earlier this month.
"The degree of violence present in this case is horrific," Nel said.
The athlete's longtime coach, Ampie Louw, told reporters Friday that he is considering putting the athlete back in training "to get his mind clear."
Pistorius has canceled planned track appearances and several corporate sponsors - the most recent of them Nike on Thursday - have distanced themselves from him.
While Pistorius may not be emotionally ready to think about running, Louw said, "the change is that he is heartbroken, that is all."
"For me it is tough to see that," Louw said. "The sooner he can start working the better."
In a poignant aside to the case, the South Africa edition of Heat, a celebrity gossip magazine, on Friday published what it said was Steenkamp's last interview, a week before her death, in which she said the couple had not been discussing their relationship publicly in the media "because I don't want to get it tainted."
"I don't want anything coming in the way of his career," she said, according to an advance excerpt from the interview. "He's such an amazing athlete."
"You know what they do, they make things up, 'Reeva cheats on Oscar' and rubbish like that. I wouldn't want lies about us jeopardizing it."
On Thursday, the case was partially eclipsed by developments in the prosecution camp, when the South African police replaced the lead investigator, Botha, after revelations that he was facing seven charges of attempted murder stemming from an episode in which police officers fired at a minivan.
The national police commissioner, Riah Phiyega, said a divisional police commissioner, Lt Gen Vinesh Moonoo, would take over the case.