Pretoria, South Africa (CNN) -- Oscar Pistorius left jail Friday, free on bond eight days after the shooting death of his model girlfriend, Reeva Steenkamp.

Magistrate Desmond Nair said the state had problems with its investigation and had not offered enough proof to keep Pistorius jailed.

"I come to the conclusion that the accused has made a case to be released on bail," Nair said, eliciting a celebratory cry of "Yes!" from the courtroom.

"We are relieved," said Pistorius' uncle, Arnold, speaking on behalf of the family.

Pistorius, who wept throughout much of Friday's hearing, remained quiet and reserved after the announcement and did not appear to celebrate. His family hugged quietly.

"As a family, we know Oscar's version of what happened that tragic night. And we know that that is the truth and that will prevail in the coming court cases," his uncle said.

Pistorius is accused of premeditated murder in the February 14 shooting death of Steenkamp, 29.

Prosecutors say Pistorius, 26, killed her after a heated argument in the early morning hours of Valentine's Day.

The sprinter says he thought an intruder was hiding in a toilet room inside the bathroom of his Pretoria home. He says he fired in a fit of terror before realizing Steenkamp was inside.

"I'd like to ask Oscar why he didn't lean over and touch my cousin first...and say 'are you okay?' 'keep quiet,' 'I'm coming now,'" said Kim Martin, Steenkamp's cousin.

In full: Pistorius' affidavit to court

While recounting a litany of "improbabilities" in Pistorius' account, Nair said defense attorneys had done enough to prove the "exceptional circumstances" required by South African law for the release of a suspect charged with premeditated murder.

He said the former chief investigator in the case, Hilton Botha, had made "several errors and concessions" in his testimony at the bail hearing, and said prosecutors had failed to prove that Pistorius was a flight risk or had a propensity toward violence.

Botha was replaced after prosecutors reinstated attempted murder charges against him in a 2011 incident unrelated to Pistorius.

Key arguments

During the four-day bail hearing, prosecutors argued that Pistorius had a history of violence and that his account didn't add up.

Prosecutors relied heavily on Botha's testimony, including statements from witnesses, who said they heard Pistorius and Steenkamp arguing before the shooting, as well as ballistic evidence that Botha said proved Pistorius was lying about how he had shot into the door.

But Botha seemed to buckle under questioning from defense attorney Barry Roux, who got the detective to acknowledge that the bullet evidence wasn't as conclusive as he had initially said and that at least one witness he had spoken to could not say for certain that the sounds he had heard came from Pistorius' house.

Nair also said that Botha had failed to exhaustively check cell phone records and chided the investigator for failing to check with Interpol before testifying that Pistorius owned a home in Italy -- raising his profile as a potential flight risk.

The source of the information about the house apparently was a magazine article, the judge noted.

Roux also said that defense investigators had found a bullet missed by police and that police may have contaminated the crime scene by failing to wear protective shoe covers. Police had run out of the covers, Botha testified.

Nair said he wasn't convinced by prosecution arguments that Pistorius had a violent nature and was a threat to the public. The prosecution cited an incident in which Pistorius reportedly fired a gun on accident inside a Johannesburg restaurant and another in which he allegedly made violent threats.

Finally, Nair said Botha had "blundered" in testifying that a substance recovered from Pistorius' home was testosterone. Some outsiders to the case have speculated that steroids or other substances could have played a role in the killing.

The defense lawyer told Nair the substance was a legal herbal remedy. Tests are ongoing, authorities said.

Too soon to judge

On the other hand, Nair said Pistorius' account is full of "improbabilities," from why he did not know Steenkamp had gotten out of bed to why he would have charged toward the bathroom door -- where he believed he had an intruder cornered -- if he was as scared for his life as he claimed.

Nair warned that it is too soon to judge the state's case, and he noted that a wide range of experts beyond Botha had worked on the initial phases of the investigation -- from ballistics experts to specialists in blood spatter.

"The pieces of the puzzle may not yet all be before me," he said.

Conditions of bail

Pistorius left jail in a Land Rover chased by paparazzi on motorcycles Friday afternoon after posting a cash bond of 100,000 Rand (about $11,200). Another 900,000 Rand (about $100,800) is due by March 1, Nair said. He headed to his uncle's home after his release.

He cannot return to the home where the shooting happened, has to give up his passport and can't go near an airport, Nair ruled. He also can't drink alcohol and must report to authorities four times a month.

Read more: What's life like in a South African prison?

Investigator's removal

The decision comes a day after the South African Police Service moved to remove Botha from the case.

Botha, a 22-year detective, is accused of seven counts of attempted murder after allegedly chasing and firing on a minibus full of people while drunk, according to officials.

A spokeswoman for South Africa's prosecution service said the accusations would be little more than a "speed bump" in the case.

Friend reacts

Model Vanessa Haywood, a South African model who is friends with Pistorius, said the murder charge doesn't fit with the kind-spirited man she knows. And she said she can relate to Pistorius' story of being filled with terror at the thought of an intruder.

"It's not the safest place in the world," she said of crime-ridden South Africa, where murder and carjacking cases are common. "My own home is like a prison. His version of events isn't as far-fetched as people think it is."

'Blade Runner'

Pistorius earned the nickname "Blade Runner" as he competed on special carbon fiber blades in place of more traditional prosthetic limbs. He was born missing bones in his lower legs, and doctors amputated his legs below the knees when he was 11 months old.

Pistorius attained fame as a symbol of triumph over adversity when won a challenge to compete in the London Olympics. While he failed to medal there, he smashed a record to win the men's 400-meter race in the Paralympic Games a few weeks later.

He is considered a national hero in South Africa.

Pistorius put his career on hold after his arrest, and sponsors Nike and Oakley suspended their contracts with him.

Read more: Nike's bullet ad with Pistorius backfires

His coach said Friday before the bail decision that, should he be let out on bail, the runner would resume training.

CNN iReport: What my son taught me about Oscar Pistorius

Diane McCarthy reported from Pretoria. Michael Pearson reported and wrote from Atlanta. CNN's Robyn Curnow, Chelsea J. Carter, Nic Robertson, Ben Brumfield, Kim Norgaard and Diane McCarthy also contributed to this report.