The High Court said on Wednesday that the girl had been wrongly convicted by a juvenile court of having premarital sex.
Her stepfather is on trial for her rape, though she was charged after police allegations that she had consensual sex with another man.
The court said the sentence had been based on a confession the child made while she was suffering from post-traumatic stress disorder, adding she had been "unfit for trial."
The Maldivian government had appealed on behalf of the teenager following an international outcry over the February sentence of 100 lashes when she reached the age of 18.
Premarital sex is illegal under Maldivian law, which is based on British common law but also has a sharia element.