Image copyright Jennifer Koop Image caption A female medium ground finch, one of at least 14 species of Darwin’s finches in the Galapagos Islands

The birds that helped Charles Darwin refine his theory of evolution are in danger of becoming extinct, according to a new study.

Finches in the Galapagos Islands are being threatened by a parasitic fly that attacks their young.

A new mathematical model suggests that the birds may succumb to this pest in 50 years.

But the authors say that human intervention could alleviate the risk of extinction.

During his time on the Galapagos in the early 1830s, Charles Darwin noticed that finches on different islands in the chain were quite similar but had large variations in their beaks, depending on the local food source.

Because the islands - which belong to Ecuador - are so far from the mainland, Darwin concluded that the birds had begun as one species and then started to evolve into separate varieties of finch.

There are between 14 and 18 species on the Galapagos - but this study looked at one of the most common, the medium ground finch. Around 270,000 of these birds are found on Santa Cruz island.

'Nasty customers'

The finches are threatened by a nest fly which lays parasitic larvae in their nests which attack the young, usually at night.

"They are maggots basically, is what they are," said Prof Dale Clayton from the University of Utah, the senior author on the study.

"Some of the eggs are laid in the nostrils of the nestlings so those eggs hatch and the larvae begin feeding immediately in the nostrils so you see perforations through the bill in especially bad cases.

"They are pretty nasty customers."

The flies are believed to have arrived in the Galapagos in the 1960s.

Image copyright Jennifer Koop Image caption A finch nestling with nostril and abdomen lesions caused by infestation with parasitic fly larvae

Prof Clayton and his colleagues developed a mathematical model using five years of data to project the impact of fly damage on the reproduction rates.

Finches breed more successfully in years when relatively high rainfall increases the food supply. They tend to do badly during extremely wet or dry years.

In two of the three scenarios that they modelled, the finch populations were declining and at risk of extinction. In the worst scenario the birds would be gone in 50 years.

The model showed that the critical elements in their survival were the probability that a given nest was infested by flies and to a lesser extent the proportion of adult finches that survive from one year to the next.

But the model also contains some good news according to the paper's first author, Dr Jennifer Koop, who carried out the research as a doctoral student and now is an assistant professor of biology at the University of Massachusetts Dartmouth.

"Even though these guys may be going locally extinct, the model also shows that if you can reduce the probability of infestation, then you significantly alleviate the risk of extinction," she said.

Image copyright SPL Image caption The beaks of the finches recorded by Darwin were a key part of the evidence for evolution

The researchers argue that if the number of infected nests could be reduced by 40% then the risk of extinction would essentially be lifted.

There are a number of human interventions that could achieve this, they say, including the introduction of wasps that would lay their eggs in the fly larvae which would destroy them.

Another idea is to use pesticides. Cotton balls would be treated with the chemicals and left for the birds to incorporate into their nests.

"The birds will travel up to 60 feet or so and pull the cotton out and line their nests," said Prof Clayton,

"If they get at least a gram of that fumigated cotton in their nests, you kill 100% of the flies."

The scientists say that the stress from the flies might also provoke an evolutionary response in the finches. They point to a related species where the nestlings learned to become more vocal when attacked by the pest, as a result the parents fed them more and their survival rates improved.

Researchers are concerned that these threatened finches may simply not have enough time to adapt.

Follow Matt on Twitter @mattmcgrathbbc.