Supporters could be heard saying "yes", and members of the athlete's family wept and appeared to pray after Chief Magistrate Desmond Nair announced his decision following a 90-minute speech to the court in Pretoria.
"Blade Runner" Pistorius, 26, is accused of murdering 29-year-old model Reeva Steenkamp at his home last week but claims he shot her through a bathroom door thinking she was an intruder.
Realising his mistake, he broke the door down with a cricket bat and carried her downstairs, he claims.
During the lengthy hearing, Pistorius was obviously emotional, sobbing as Mr Nair summed up the evidence the court has heard, including the Paralympian's own account of what happened when he opened fire.
Granting bail to the athlete at Pretoria Magistrates' Court today after a four-day hearing, Mr Nair, who previously described his task as "unenviable", said there was no suggestion that Pistorius was a flight risk, he did not appear to have a propensity to violence, and there was no evidence that he would interfere with witnesses.
He said Pistorius had "reached out" in his affidavit describing what had happened, and - pausing before he delivered his final decision to the packed courtroom - said: "I come to the conclusion that the accused has made a case to be released on bail."
Pistorius himself was reported as bursting into tears after the decision was announced.
Bail was fixed at 1 million rand (£73,822) including 100,000 rand (£7,382) in cash.
Pistorius must surrender any firearms and his passport and cannot enter any international departure hall.
He is also banned from using any prohibited substance or alcohol.
The case was adjourned until June 4.
In his affidavit, Pistorius described waking up in the early hours of Valentine's Day and going on to his balcony to bring in a fan and close the sliding doors.
He said he heard a noise in the bathroom and was overcome by a sense of "terror", thinking someone had broken in.
He fired shots at the toilet door, shouting to Ms Steenkamp to call the police and, when she did not reply, realised she was in the bathroom.
The prosecution said Ms Steenkamp locked herself in the bathroom either to escape an argument or to escape the gun.
During the hearing, the prosecution claimed there was a risk of the athlete fleeing if the court released him on bail, and prosecutor Gerrie Nel said he had the "money, means and motive" to do so.
He said Pistorius's version of events was "improbable", compared with the state's case which was based on "objective facts".
But the Paralympian's defence claimed he is so famous he will not be able to flee, and any effort to escape justice would be difficult as his prosthetic legs cannot go unnoticed through airport security, need maintenance and adjustment on a monthly basis, while his own legs need regular medical treatment.
Pistorius's coach, Ampie Louw, who described the athlete as "heartbroken" over the death of his girlfriend, said earlier that, if he was given bail, he could resume training next week.
Mr Nair also referred to evidence given by Warrant Officer Hilton Botha, who was replaced as lead investigator in the case yesterday after he was charged with multiple counts of attempted murder in a different case.
In the case, which was previously dropped, Botha and two other police officers are said to have fired shots at a minibus carrying seven people in October 2011. He is due to appear in court himself in May.
During his ruling on Pistorius's bail application today, Mr Nair said Botha had made "several errors and concessions" during cross- examination.
He said the officer had not asked for all the mobile phones, may have contaminated the crime scene, "blundered" on the description of substances found at the property, and did not spend as long as he ought to have if he wanted to establish that the athlete had a propensity to violence.
"It can never be said that Warrant Officer Hilton Botha is the state case," he said. "The state case will be put together by experts."
Speaking on behalf of Pistorius's family, his uncle Arnold told reporters: "We are relieved of the fact that Oscar got bail today.
"But at the same time we are in mourning for the death of Reeva with her family.
"We are also grateful for the magistrate for coming to the conclusion and for our legal team that has delivered extremely professional and legal statements that led to the decision of giving bail today.
"As the 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 case."
Speaking outside court, Medupe Simasiku, from South Africa's National Prosecuting Authority (NPA), told reporters: "The bail application does not mean that this person is acquitted."
He said there was more work to be done and, when the court meets again on June 4, they will have a better idea of when a trial can be held.
Kenny Kunene, a friend of the athlete, told Sky News that Pistorius had not been given any special treatment, and said the case had taken a toll on Pistorius and his family.
"It has obviously taken a serious toll because they stopped doing everything and they focused on this particular bail application, they have been here every day," he said.
"It has taken a lot from them, it has taken a toll on me as a friend, and I think today was more of a relief.
"It was a great day for Oscar and for everybody that loves him.
"Obviously he will have to focus on the case and I think the conditions bind him. They give him time and space to focus on this case, particularly with support from the family."
Kim Myers, a friend of Ms Steenkamp - whose own family were not in court today - told Sky News: "This is a bail application, not a trial, and we hope and pray that justice will prevail.
"It's still a very sad time for us and we need to remember that somebody did lose their life, and our hearts, thoughts and prayers just go out to the Steenkamp family.
"We're still very sad. She was an amazing person."