Ban handed over the letter, addressed to Malala's parents, to Pakistan's new representative to the UN, Masood Khan, reports the Daily Times.
"Malala is a role model not only for your country, but for our world," Ban wrote in the letter, adding that education was a fundamental right for everybody. He further said the UN was partnering with the people of Pakistan in their struggle to promote education.
Ambassador Khan said the Pakistani leadership and the entire nation had condemned the abominable act of violence against Malala.
"The whole nation is united against this kind of obscurantism. Malala has been an icon of education for girls and an inspiration for the international community," Khan said.
Malala, who earned international fame for raising a voice against Taliban oppression in Swat, was shot in the neck and head when the Tehrik-i-Taliban Pakistan (TTP) opened fire on her school van in Swat valley on Tuesday. Two other girls also sustained injuries.
The incident has sparked widespread condemnation within Pakistan and across the world. Malala is currently fighting for her life in a military hospital in Rawalpindi after a surgery that removed a bullet from her head.