The Christian girl, who has been accused of defaming Islam, has been granted bail days after a Muslim cleric was detained on allegations of planting burnt pages of Koran in her bag to frame her.
Judge Muhammad Azam Khan ordered the release of the 14-year-old upon producing two sureties to the tune of $10,500 (£6,200).
"The bail application has been accepted against two sureties of 500,000 rupees ($5,200) each," announced the judge.
The girl will be reunited with her family at a secret location due to security reasons, Reuters reported, quoting local officials.
However, it was not clear when the girl, referred to as Rimsha Masih, would be released or the girl's family could afford the bail amount.
She has been detained in a high security prison since 16 August.
"I am really satisfied and happy. I believe justice has prevailed," said Pakistan's Minister for National Harmony Paul Bhatti.
The arrest of the girl has sparked international condemnation as she was said to be mentally challenged. Doctors have certified that she appeared to have a mental age lower than her chronological age.
Rights groups and campaigners have welcomed the verdict, which is "rare" in blasphemy cases. Blasphemy is a serious crime in Muslim countries which often ends up either in death penalty or life imprisonment.
"This child should not have been behind bars at all. All charges against her should be dropped," said Human Rights Watch.
"Pakistan's criminal justice system should instead concentrate on holding her accuser accountable for inciting violence against the child and members of the local Christian community."
The girl's father earlier said he feared for his daughter's life and the safety of the family. Ever since the incident, the family has been in protective custody.