Unrelated friends share a high proportion of similar genes, proving that birds of a feather really do flock together, a study shows.

Researchers made the discovery after analysing almost 1.5 million markers of gene variation from around 2,000 people.

Pairs of unrelated friends were compared with pairs of unrelated strangers. The study found that, on average, about one per cent of the genes of friends matched each other.

Friends with no biological connection had as much genetic similarity as fourth cousins or people who share great, great, great grandparents.

US lead scientist Professor James Fowler, from the University of California at San Diego, said: "Looking across the whole genome, we find that, on average, we are genetically similar to our friends. We have more DNA in common with the people we pick as friends than we do with strangers in the same population."

Focusing on different sets of genes revealed that those affecting sense of smell were among the most similar in friends.

A possible reason is that our sense of smell draws us to similar environments, say the scientists.

People who enjoy the aroma of coffee, for instance, may be more likely to frequent cafes, providing an opportunity to make friends with others of a similar disposition.

The opposite was true for genes controlling immunity. Friends were more likely than strangers to have different genetic defences against various diseases.

A dissimilarity between immune system genes is also seen in spouses. The scientists believe it may reflect the evolutionary advantage of connected people withstanding a wide range of infections.