People are infected with malaria from parasites inside mosquitoes
Parasites ensure the spread of malaria by being able to produce more sons than daughters when conditions are difficult, a new study has found.
Edinburgh university scientists said their discovery could give clues in the fight to stop the disease spreading.
Determining when the parasites are likely to favour producing one sex over the other could assist the development of anti-malarial drugs and vaccines.
Parasites have to produce offspring inside a mosquito to transmit malaria.
Parasites, which are sucked up into a mosquito from infected blood while it is having a meal, have 20 minutes to reproduce.
The female single-celled organism turns into an egg and the male splits up into eight sperm.
However, when conditions are unfavourable inside the mosquito's gut, parasites adjust their production of males and females to maximise their reproduction.
The parasite offspring then move to the mouth of the mosquito and when it next takes a meal they are injected into the next human via its saliva.
The Edinburgh scientists said it showed how malaria parasites were more sophisticated than previously thought.
They can respond to changes in their social situation and environment, something that is traditionally associated with more complex animals such as insects, birds and mammals.
Usually, malaria parasites will tend to produce more daughters than sons, because all the females are expected to find a mate.
However, in harsher conditions, for example when under attack from a person's immune system, or when competition to breed is high among the parasites, it is beneficial to have more sons, to increase the overall chance of their genes being passed on.
The study, published in the journal Nature, was funded by the Natural Environment Research Council, Biotechnology and Biological Sciences Research Council and the Wellcome Trust.
Dr Sarah Reece, of the University of Edinburgh's School of Biological Sciences, who led the study, said: "We have long suspected that malaria parasites adjust their production of males and females to ensure their spread, and we have now shown that this is the case.
"We hope that by understanding the family planning strategy of these parasites, ways can be found to stop the spread of malaria."