Some people may be genetically destined to have a generous personality, Israeli research has suggested.
People had to decide whether to keep money, or give it away
A total of 203 people took part in an online task in which they could either keep or give away money.
Gene tests revealed those who had certain variants of a gene called AVPR1a were on average nearly 50% more likely to give money away.
The study, by The Hebrew University of Jerusalem, appears online in the journal Genes, Brain and Behavior.
Lead researcher Dr Ariel Knafo said: "The experiment provided the first evidence, to my knowledge, for a relationship between DNA variability and real human altruism."
The gene AVPR1a plays a key role in allowing a hormone called arginine vasopressin to act on brain cells.
Vasopressin, in turn, has been implicated in social bonding.
The researchers found greater altruism in players in which a key section of the gene, called its promoter, was longer.
The promoter is the region that determines how active a gene is. In this case a longer promoter makes the gene more active.
The researchers point out that a version of AVPR1a also exists in voles, where it also promotes social bonding.
This, they say, suggests that altruism has a long rooted genetic history.
Dr George Fieldman, a lecturer in psychology at Buckinghamshire New University, said carrying genes which promoted altruism and social bonding made evolutionary sense.
He said the success of altruism as a strategy was based on the idea that a good deed was likely to be reciprocated.
However, the odds of that happening among strangers were lower than among people who were known to each other. Therefore, the impulse to bond socially, and make new friends, was important.
He said: "Because society is becoming increasingly complicated, it is probably more important to be altruistic and co-operative than it was in our ancestral history."