Rimsha Masih spent three weeks on remand in an adult jail after she was arrested on August 16 for allegedly burning pages from the Qur'an.
She was released on bail in September and police have since told the courts she was not guilty and that a cleric who allegedly framed her should face trial instead.
"The court has quashed the case, declaring Rimsha innocent," her lawyer Akmal Bhatti said.
Blasphemy is an extremely sensitive issue in Pakistan, where 97% of the population are Muslims, and under the country's penal code insulting the Prophet Muhammad can be punished by death.
Rights activists have urged Pakistan to repeal the legislation, arguing it is often used to settle personal disputes. The issue is so sensitive that even unproven allegations can provoke a violent public response.
Paul Bhatti, the only Christian member of Pakistan's federal Cabinet, welcomed the "historic" move from the high court in the capital Islamabad, saying justice had been done.
"It will send out a positive image of Pakistan in the international community that there is justice for all and that society has risen up for justice and tolerance," he said.
He paid tribute to Muslim clerics, members of the media and civil society for also playing a "positive role" in highlighting the injustice done to Rimsha.
"The historic decision will deter people from levelling false accusations against others," he said.
Rimsha and her family, who have been in fear for their lives since the allegations broke, had been moved to an undisclosed location after her release on bail on September 8.
An official medical report classified her as "uneducated" and 14 years old, but with a mental age younger than her years. Others have said she is as young as 11 and suffers from Down's Syndrome.
"It was a fake case, so the court has ordered it finished," said defence lawyer, Tahir Naveed Chaudhry.
The prosecution said it would appeal the decision.
"We will definitely challenge the high court order in the Supreme Court," said Rao Abdur Raheem, the lawyer for Rimsha's neighbour Hammad Malik, who filed the original complaint.
Tampering with evidence
Cleric Hafiz Mohammed Khalid Chishti, who gave police burned papers as evidence against her, was detained on September 1 for himself allegedly desecrating the Qur'an and tampering with evidence.
He was also granted bail last month.
On August 24, Chishti said he thought Rimsha burned the pages deliberately as part of a Christian "conspiracy" to insult Muslims, and demanded action against what he called their "anti-Islam activities" in the impoverished Mehrabad neighbourhood of Islamabad.
International outcry also erupted in November 2010 when a court sentenced Christian mother of five, Asia Bibi, to death after Muslim women claimed she made derogatory remarks about the Prophet Mohammed.
Bibi is still in prison, pending an appeal process through the courts. – AFP