(CNN) Picture this: a 19-month-old hungry baby picks up a delicious snack, but instead of gobbling it up gives it to an adult who appears to want it, too.

Now imagine dozens of different babies of the same age doing the same. And that's exactly what happened during a study published Tuesday that tests the beginnings of altruism in humans.

The babies "looked longingly at the fruit, and then they gave it away!" said Andrew Meltzoff, co-director of the Institute for Learning & Brain Sciences at the University of Washington, in a statement. "We think this captures a kind of baby-sized version of altruistic helping."

Meltzoff and his team studied nearly 100 babies who were 19 months old, a time when many babies are starting to have temper tantrums, especially when told no, according to the American Academy of Pediatricians (PDF). This is also the age that babies are likely to hit, bite or scratch others when denied what they want, a part of their developmentally appropriate experiments with new behaviors.

When does altruism begin?

Food sharing among adult nonhuman primates, such as chimpanzees, is rare, studies show. When they do, it appears to be among close relatives, or when they think it will benefit them by strengthening relationships with other chimps outside their inner circle.

Yet humans often respond to hungry people, whether it's through food banks, fundraisers or sharing their snack or lunch.

"We adults help each other when we see another in need, and we do this even if there is a cost to the self. So we tested the roots of this in infants," said lead author Rodolfo Cortes Barragan, a postdoctoral researcher at the Institute for Learning & Brain Sciences, in a statement.

Using baby fruit favorites such as blueberries, bananas and grapes, the study tested whether the infants would spontaneously, without being asked, give their food to a total stranger.

Sitting across from the adult, each baby was shown a piece of fruit that was then gently tossed onto a tray on the floor within the child's reach but beyond that of the researcher's. If the child was in the control group, the researcher did nothing and showed no emotion.

Researcher in the "begging" group acts like he wants the food.

If the baby was in the test group, called the "Begging Experimenter Group," the researcher appeared to toss the fruit accidentally and then tried unsuccessfully to reach for it.

More than half of the babies in the test group, apparently triggered by the adult's obvious desire for the treat, picked up the fruit and gave it to the adult, the study said. Only 4% of the babies in the control group did the same.

Babies gave even when hungry

A second experiment was set up with a different group of 19-month-old babies. In this case, the babies were tested at their snack or meal time, when they were typically hungry. This, researchers thought, would raise the stakes and impact the motivation of the children to keep the fruit for themselves.

The babies in the control group did just that. But 37% of the test group who believed the adult was hungry picked up the fruit and gave it away.

However, said psychologist Mark Strauss, who directs the Infant and Toddler Development Center at the University of Pittsburgh, "we really don't know that the differential behavior between the two groups has to do with food. It could be that the toddlers recognize in the 'begging condition' that the adult didn't want to drop and they are being helpful.

"Finally, given that the children may not have been hungry," said Strauss, who was not involved in the study, "there really is no evidence that the children are being altruistic, but rather just being helpful."

Get CNN Health's weekly newsletter Sign up here to get The Results Are In with Dr. Sanjay Gupta every Tuesday from the CNN Health team.

Were the babies more willing to give up the fruit if they had practice at it?

No, they were just as giving in the first trial as they were in later episodes. What did appear to matter, the study found, was if the child had a sibling or came from a society that values what psychologists call "interdependence ."

"We think certain family and social experiences make a difference, and continued research would be desirable to more fully understand what maximizes the expression of altruism in young children," Barragan said. "If we can discover how to promote altruism our kids, this could move us toward a more caring society."