Since we humans have no tails to wag, our best friends have to look elsewhere for signs we feel happy and friendly. A new study indicates dogs can learn to distinguish a smile, even on the faces of some strangers.

This ability to learn to recognize smiling faces may have been important to the success of dogs living with humans, the researchers noted in their study.

Social animals need to be able to read others' emotions, and the cues they rely upon vary by species, the researchers said. Among humans, facial expressions are vital cues. Dogs (and wolves) also use facial expressions, such as bared teeth to show aggression, as well as postures to communicate with one another, lead researcher Miho Nagasawa of Azabu University and colleagues write in the July issue of the journal Animal Cognition. [10 Things You Didn't Know About Dogs]

But can dogs distinguish between human expressions? Our furry friends do come into close, daily contact with humans, and even though the faces of humans and dogs have different structures, dogs often respond to visual cues from humans, as pet owners can attest.

The researchers trained nine pet dogs using photos of their owners, who were smiling in some of the photos and looking neutral in the others. The dogs were trained to touch their nose to photos of their owner's smiling face. Only five of the dogs five completed this training.

These dogs were then shown photo pairs of smiling and blank-expression faces of unfamiliar people as well as of their owners. When shown photo pairs of either their owner or a stranger who was the same gender as their owner, the dogs selected the smiling faces more often than would be expected if they were randomly choosing a photo.

Dogs may be picking up on obvious differences in facial features between the smiling and blank faces, such as the exposed teeth associated with smiling, according to the researchers.

Although five dogs may seem like a small sample size, it is common for animal cognition studies like this one, according to Monique Udell, who studies canine cognition and behavior at the University of Florida. Udell wasn't involved with the study.

"Really what matters is the ability of individual subjects to reach criterion. If even one dog can do it reliably (or in this case five), this suggests that dogs are 'capable' of making the discrimination," she told LiveScience. "That doesn't necessitate that all dogs will be good at it."

"We know that dogs are very good at picking up on subtle cues given by humans, but often those involve movement and occur in the presence of the actual person. It is interesting that picture discriminations of this type can be trained in dogs as well," Udell wrote in an email.

The ability to recognizing human facial expressions, as well as other human cues, does not appear to be innate. Rather the dogs acquire it as they come to associate, say, a smile with a reward, like extra doggie treats or affection, according to Udell.

"This study has shown that dogs that live closely with humans are also able to recognize positive facial expressions, indicating that these dogs have acquired the social skills helpful to survive. The ability to learn to discriminate human facial expressions must have helped dogs to adapt to human society," Nagasawa's team concluded in the study.

But the dogs' recognition abilities had limits. In another test, when the gender of the person in the photos switched, the dogs' performances dropped.

It is possible that facial expressions differ between men and women or that the dogs' close relationships with their owners interfered with their ability to recognize smiles on the faces of the opposite gender, the researchers write.

You can follow LiveScience writer Wynne Parry on Twitter @Wynne_Parry. Follow LiveScience for the latest in science news and discoveries on Twitter @livescience and on Facebook.