The appeals court in Rabat sentenced one man to 20 years in prison early Friday and the other two to 10.
All three could have faced up to 30 years behind bars.
The appeals court ordered the three men to pay damages totalling 140,000 dirhams (nearly $14,000) instead of the 50,000 dirhams ordered by the lower court.
The defendants faced the same charges as in the original trial - "misappropriation of a minor" and "indecent assault on a minor with violence".
The prosecution requested that "rape" be added to the charges, a request rejected by the judge.
"We are satisfied with the decision which delivered justice to the victim," lawyer Abdelfattah Zahrach told AFP after the marathon hearing.
"That said, we do not understand why two of the accused have been only sentenced to 10 years," he said, adding that he was considering a further appeal to the Court of Cassation "after consulting the child's family."
Lawyers for the girl, who is now 12, had appealed after a lower court sentenced one of her three alleged attackers to two years in prison, and the others to 18 months each.
The court had heard testimonies from the victim and a witness, also a minor, in private after the prosecution requested it, citing child protection concerns.
The public gallery was packed for Thursday's hearing, which ran on into the early hours of Friday.
The victim, looking frail and silent, was accompanied by her grandmother and father.
The accused hung their heads in the dock as the evidence was presented.
One of the men was confronted with a DNA test proving that he is the father of a now 13-month-old child born to the girl.
Asked how this happened, he repeatedly said, "I don't know."
The case has caused an uproar in the North African country, and a petition condemning the March 20 sentences has amassed tens of thousands of signatures.
The girl, from a village near Rabat, was raped repeatedly over several months, the Jossour Forum of Moroccan Women said in a statement last month.
Amina Khalid, head of INSAF, a women's rights group which has followed the girl's case, said she "is starting to smile a little but she is still in shock".
INSAF has helped the girl go to school for the first time.