Fabulous graphics accompany a piece by Stephen Yin on the New York Times site June 14

Two bacteria are sitting near free-floating DNA. Suddenly, one bacterium shoots out a long appendage, latches onto a DNA fragment and reels in its catch. It happens fast, but it’s clear: this organism had just gone fishing.

Biologists at Indiana University recently captured this maneuver on camera for the first time.

Their findings, published Monday in the journal Nature Microbiology, verify the existence of a harpoon-like mechanism that scientists have been piecing together for decades.

The work also advances understanding of how bacteria take up DNA from their surroundings, which is called natural transformation. That process is key to the spread of antibiotic resistance, which has made bacterial illnesses increasingly difficult to treat with conventional drugs. Each year an estimated two million Americans become infected with antibiotic-resistant bacteria.

Researchers knew that bacteria rely on fibers called pili to capture foreign DNA. But the exact details have remained elusive because pili — more than 10,000 times thinner than human hair — are so hard to observe, said Lori Burrows, a professor of biochemistry and biomedical sciences at McMaster University in Ontario who was not involved in the study.

“It’s cool to actually see this in action,” she said.

We typically think of genes as passed down vertically, from parent to offspring. But there are also processes called horizontal gene transfer, in which DNA moves laterally between organisms that are not parent and child.

Natural transformation is one example, and it’s an important way in which bacteria, which typically reproduce asexually, introduce variation and new traits into their genetic code, said Ankur Dalia, an assistant professor of biology and an author of the new paper.

The process has mesmerized biologists since 1928, when a British bacteriologist named Frederick Griffith stumbled across it while searching for a pneumonia vaccine.

To his amazement, he discovered that if he injected a heat-killed, virulent strain of Streptococcus pneumoniae, followed by a live, nonvirulent strain, bacteria that were normally innocuous would somehow become pathogenic.

A “transforming principle” had to be at play, he declared.

Sixteen years later, scientists showed that the transforming principle was in fact a molecule called DNA, providing one of the first clues that DNA carried genetic material.

When bacteria die, their DNA becomes up for grabs by other microbes. Often, this process is bad news for humans. Through natural transformation, bacteria can gain the ability to degrade compounds like pesticides, become better at infecting hosts and evolve antibiotic resistance.

In their study, Dr. Dalia and his colleagues used a custom fluorescent dying process created by Courtney Ellison, a graduate student, and Yves Brun, a biology professor, to visualize natural transformation in Vibrio cholera, the bacterium that causes cholera.

Ms. Ellison recounted dashing into Dr. Dalia’s lab and blurting “you need to follow me right now” after she became the first person to directly witness the behavior.

In the wild, V. cholerae engage in natural transformation when they land on a piece of chitin, a major ingredient in insect and crustacean shells, and a rich source of nutrients

“It’s exactly the kind of environment other bacteria would be latching onto,” and therefore a good site for DNA swapping, Dr. Dalia said.

When the researchers induced this behavior in the lab, they were able to discern new details about how V. cholerae latch onto DNA at the tip of their pili, fold and thread the DNA through a tiny surface pore and then pull it into their bodies using a special ratcheting mechanism.

Pili in V. cholerae can stretch about as far as the length of the bacteria. The organisms make one or two pili a minute, extending and retracting the appendages with proteins that quickly build the pili up and then tear them back down.