Prosecutors said her conviction did not relate to the rape case.
Amnesty International condemned the punishment as "cruel, degrading and inhumane".
The government said it did not agree with the punishment and that it would look into changing the law.
Zaima Nasheed, a spokesperson for the juvenile court, said the girl was also ordered to remain under house arrest at a children's home for eight months.
She defended the punishment, saying the girl had willingly committed an act outside of the law.
Officials said she would receive the punishment when she turns 18, unless she requested it earlier.
The case was sent for prosecution after police were called to investigate a dead baby buried on the island of Feydhoo in Shaviyani Atoll, in the north of the country.
Her stepfather was accused of raping her and impregnating her before killing the baby. The girl's mother also faces charges for failing to report the abuse to the authorities.
The legal system of the Maldives, an Islamic archipelago with a population of some 400,000, has elements of Islamic law (Sharia) as well as English common law.
Ahmed Faiz, a researcher with Amnesty International, said flogging was "cruel, degrading and inhumane" and urged the authorities to abolish it.
"We are very surprised that the government is not doing anything to stop this punishment - to remove it altogether from the statute books."
He said he did not know when the punishment was last carried out as people were not willing to discuss it openly.