A Christian girl who has been detained on blasphemy charges for three weeks in Pakistan has been granted bail.
The girl, named as Rimsha, is thought to be about 14 years old. She was arrested in Islamabad after a mob accused her of burning pages of the Koran and demanded her punishment.
Last week a Pakistani imam was remanded in custody, accused of planting burned pages of the Koran in her bag.
The case has sparked international condemnation.
Judge Muhammad Azam Khan ordered her release and set bail at about $10,500 (£6,200).
The BBC’s M Ilyas Khan in Islamabad says Rimsha is the first person accused of blasphemy to have been granted bail by a trial court.
Blasphemy is not a bailable offence but her lawyers pleaded that she was a juvenile.
Rimsha has been held at a high-security prison since 16 August. Since her arrest there have been conflicting reports about her age and mental capacity.
Doctors who examined her last month said she appeared to be about 14 and that her “mental age appears below her chronological age”.
Rimsha’s safety upon her release is likely to be a key concern for campaigners. Her father has previously said that he fears for his daughter’s life and for the safety of his family.
Her parents were taken into protective custody at an undisclosed location following threats, and many other Christian families fled the neighbourhood after her arrest.
If her bail payment is met, Rimsha is likely to be reunited with her parents, correspondents say.
There have been cases in Pakistan where people accused of blasphemy have been killed by vigilante mobs.
Indeed Rimsha was arrested by police on 16 August in a poor neighbourhood of Islamabad only after a crowd demanded her punishment, enraged by accusations that she had burned pages of the Koran.
But in an unusual development just weeks later on 2 September, police arrested a Muslim cleric from her neighbourhood after his own deputy accused him of planting pages of the Koran in a bag belonging to Rimsha.
Imam Khalid Chishti denies the allegation but prosecutors say he will be charged with tampering with evidence as well as blasphemy.
Pakistan’s strict blasphemy laws are a highly sensitive subject in the country, but they are also often used to settle personal vendettas, correspondents say.
This case has only served to intensify concerns over the misuse of Pakistan’s blasphemy laws.
Rights activists have long urged Pakistan to reform the laws, under which a person can be jailed for life for desecrating the Koran.
In March 2011 Shahbaz Bhatti, the minister for minority affairs, was killed after calling for the repeal of the blasphemy law.
His death came just two months after the murder of Punjab Governor Salman Taseer, who also spoke out about the issue.