The toddler, who can only be identified as M, died Thursday night only hours after the Supreme Court of Canada denied a motion to keep her on life support.
Her parents, who also cannot be named, are facing several criminal charges and remain in custody.
"It's very sad. It's very sad to see a child go through this and the parents go through this," said Khama Assaf, who attended the service, but did not know the family.
"It's very, very sad for the whole community. Everybody knows. The whole community knows. And [anyone] who has time today, they came for the funeral."
In May, paramedics were called to the family's home where they found the child with a head injury and in cardiac arrest. Both the girl and her twin sister were severely malnourished. The second girl is recovering.
Both parents were allowed to attend the funeral while under guard, but were not allowed contact with one another.
The girl's mother was visibly distraught during the service, barely able to stand at times.
Imam Mustafa Khattab said the family were not members of his mosque, but he took responsibility for the girl's funeral after being called in to pray over her while she was in hospital.
Khattab said that although many of the mourners did not know the family personally, the news of her death has nonetheless hit the community hard.
"It's a very devastating experience for everyone; it’s a very difficult moment," Khattab said.
Parents could face more charges
The Supreme Court of Canada on Wednesday rejected a stay of the Alberta Court of Appeal ruling that allowed doctors to remove M from a ventilator.
The parents face charges of aggravated assault, criminal negligence causing bodily harm and failing to provide the necessities of life.
More charges could be laid after the results of a toxicology report are completed, which police say could take a few weeks.
None of the allegations have been proven in court.
Also on HuffPost