A child’s ability to understand sarcasm may be directly linked to her capacity to empathize, a new study suggests.

In research conducted by Penny Pexman of the University of Calgary and published in the journal Frontiers in Psychology, children’s empathy skills were examined to see if their ability to adopt the perspective the speaker allowed them to understand sarcasm.

"For children to be able to cope with that, they have to learn that you have to essentially ignore the literal meaning of their words and have to get inside the speakers' heads and say, 'What do they really think about this?' To do that seems to require empathy skills," Pexman told LiveScience.

Pexman and her colleagues decided to find out why some children were able to understand sarcastic praise like "Thanks a lot!" and "Nice going!" before some of their peers. To do so, they studied 31 children ages eight and nine who watched a puppet show that included sarcastic praise. The children’s ability to understand sarcasm was measured on whether they thought the sarcastic puppet was “mean” or “nice.”

One storyline involved snowboarding. “The puppets wear goggles and there’s artificial snow, Pexman told NBC's "Today." “There’s a jump and one of the puppets snowboards off the jump and lands badly, falling on his face. The other puppet comments, ‘That was so good.’”

Parents were asked to fill out a questionnaire to measure their child’s level of empathy with questions like, "To what extent is your child visibly upset when he or she sees other people upset?"

Researchers found that the children detected sarcasm about half of the time – while children with stronger empathy skills were nearly twice as accurate as children with relatively weaker empathy skills.

"Sarcastic language, especially in unfamiliar forms, is a real challenge for most children," Pexman said in a statement. "Even when children did not recognize a remark as sarcastic, there was evidence in their reactions that the children with stronger empathy skills were sensitive to the speaker's intent."

Pexman adds that sarcasm can be learned in different ways. Children who have sarcastic parents or who spend much time around adults or older children may pick up on sarcasm sooner.

"This study helps us understand why some children deal better with this challenge than others and provides new insights about development of this complex aspect of emotion recognition," adds Pexman. "It also puts us in a better position to help children who are struggling with this challenge."