The Bajau people of Southeast Asia are among the most accomplished divers in the world. In the summer of 2015, Melissa Ilardo got to see how good they are firsthand. She remembers diving with Pai Bayubu, who had already gone fairly deep when he saw a giant clam, 30 to 50 feet below him. “He just dropped down,” Ilardo recalls. “He pointed at it, and then he was there. Underwater, the Bajau are as comfortable as most people are on land. They walk on the seafloor. They have complete control of their breath and body. They spear fish, no problem, first try.”

Sometimes known as “sea nomads,” the Bajau have lived at sea for more than 1,000 years, on small houseboats that float in the waters off Indonesia, Malaysia, and the Philippines. Traditionally, they came ashore only to trade for supplies or to shelter from storms. They collect their food by free diving to depths of more than 230 feet. They have no wet suits or flippers, and use only wooden goggles and spearguns of their own making. Sometimes, they rupture their own eardrums at an early age to make diving easier.

Not all of them dive; some avoid it entirely. But those who do take the skill to an extreme. Each day, they’ll spend more than five hours underwater, capturing between two and 18 pounds of fish and octopuses. The average dive lasts for just half a minute, but the Bajau can hold their breath for far longer. In the clip below, from the BBC documentary Human Planet, a man named Sulbin stays underwater for almost three minutes. “I focus my mind on breathing,” he told the BBC. “I only dive once I’m totally relaxed.”

Their abilities are almost certainly shaped by experience and training. But Ilardo has found evidence that they are also genetically adapted to life in the sea.

Over three trips in the summer of 2015, she got to know people from the Bajau village of Jaya Bakti in Indonesia. She explained her work as a geneticist, went diving with them, and learned about their lifestyles. On one trip, she brought along an ultrasound machine, and scanned the bodies of 59 villagers. That’s when she realized that the Bajau have unusually large spleens—50 percent bigger than those of the Saluan, a neighboring group who barely interact with the sea.

The spleen acts as a warehouse for oxygen-carrying red blood cells. When mammals hold their breath, the spleen contracts, expelling those cells and boosting oxygen levels by up to 10 percent. For that reason, the best competition free divers tend to have the largest spleens, as do the deepest-diving seals. It’s even possible to train your spleen: Erika Schagatay, from Mid Sweden University, found that after climbing Mount Everest, mountaineers empty more of their spleens while holding their breath than they could before.

But Bajau spleens aren’t big just because of training. Ilardo and her team, led by Eske Willerslev and Rasmus Nielsen at the University of Copenhagen, found that even Bajau villagers who never dive still have disproportionately large spleens. “When we saw that, we thought, okay, something’s going on and it’s likely genetic,” Ilardo says.

Using blood samples collected from the same 59 Bajau villagers, she and her team compared their DNA to that of 34 Saluan individuals and 60 Han Chinese. They looked for genes with variants that are more common in the Bajau than in the other populations—a sign of natural selection at work. And they found several contenders.

One gene, known as PDE10A, stood out. It does many things, but it’s especially active in the thyroid gland, and controls the release of hormones. The version of PDE10A that’s common in the Bajau is associated with higher levels of thyroid hormones, and those hormones, in turn, make spleens grow bigger—at least, in rodents. This might explain why the Bajau have such large spleens, and thus, such extraordinary breath-holding skills. “This shows, for the first time, that there may be a genetic background to the spleen response in humans,” says Schagatay, who was not involved in the study.

PDE10A is only part of the story. Ilardo’s team also found signs of adaptation in other genes, which they now plan to study further. One of these, BDKRB2, is the only gene that’s been previously linked to diving in humans. It affects the constriction of blood vessels in the extremities, and so controls how much oxygen reaches the core organs like the brain, heart, and lungs.

Another candidate, FAM178B, influences the levels of carbon dioxide in the blood—which is also an important factor to control when holding one’s breath. The version of FAM178B that’s common in the Bajau seems to have come from the Denisovans, a group of ancient hominids who lived in Asia. It’s clear that when modern humans entered Asia, they had sex with Denisovans and inherited some of their DNA. One Denisovan gene provides modern Tibetans with a crucial adaptation that allows them to survive at high altitudes. It’s possible that another gives the Bajau an advantage underwater. “But we haven’t confirmed that yet,” says Ilardo. “We need to do more analyses.”

These discoveries might have important medical implications. Several disorders, including strokes and heart attacks, starve the body of oxygen, so the genetic tricks that help the Bajau thrive underwater might inspire new ways of protecting patients on dry land. For the same reasons, Nielsen and his colleagues are studying the genes of people in Tibet and Ethiopia who live at high altitudes, and other people who live in extreme environments.

But it’s also important for geneticists to give back to the communities they study. Ilardo is fully committed to this; she’s already planning a return trip to Jaya Bakti to tell Bayubu and the other Bajau about her results. “I think it’s wrong to take the samples and disappear forever,” she says. “I hope they get something out of it. And I want to spread a positive message about this population.”

Ilardo says that the Bajau, like many nomadic groups around the world, face a lot of stigma from surrounding populations. One official from an Indonesian university warned her that they weren’t trustworthy. Another told her to stay away from their “love potions.” “There’s a lot of mysticism around them,” she says. “They live physically on the fringe of society, which causes them to be seen with suspicion. But they were just the most welcoming people I’ve ever met. Kepala Desa Hasan, the chief of the village, took me into his home. I have a Bajau mom and dad who adopted me.”

Their traditional lifestyles are also disappearing. Several government programs have forced many of these nomads to come ashore, and their floating homes have become harder to maintain. “They used to make their houseboats from trees with light wood, but that tree is now endangered for reasons that have nothing to do with them,” says Ilardo. “They have to use trees with heavier wood, which means motors, which means gas, which is expensive. They’re slowly becoming connected to the land, but some of them still build houses on stilts to maintain a connection to the sea.”