The group started with populations in Finland and Sweden, where 28,000 people had been studied for years. The data included their ages, weights and diseases, including diabetes.

They compared people at either end of the spectrum of diabetes risk. One group of 352 people had Type 2 diabetes even though their risk seemed low. Their average age was about 50, they were lean and they did not smoke. The other group of 406 people was just the opposite. Their average age was about 80, and, Dr. Rolph said, “they had all the bad habits — they were overweight, they drank, they smoked.” And yet these people did not have diabetes.

Two of the fat older people who were free of diabetes turned out to have a mutation that destroyed one copy of the ZnT8 gene. It was intriguing, but hard to know if the association was meaningful with only two people.

So the researchers expanded their work, studying the genes of 18,000 people in Sweden, fat and thin, old and young, with diabetes and without. They found another 31 people who seemed protected from diabetes and had mutations that destroyed the ZnT8 gene.

Then Dr. David Altshuler, deputy director of the Broad Institute of Harvard and M.I.T. and the study’s lead author, met with Dr. Kari Stefanson, chief executive of deCODE Genetics, a company with data on genes and diseases for the entire population of Iceland. The American drug company, Amgen, bought deCODE and its valuable genetic database.

Dr. Stefanson searched deCODE’s database and quickly found 39 people out of 5,440 who had a mutation that destroyed the gene and who did not have diabetes. In contrast, just nine out of 3,727 diabetes patients had the mutation.

“It took us five minutes,” Dr. Stefanson said. “It was a lovely little afternoon in our conference room.”