A tiny Western Atlantic fish does something never before seen: It makes like a bird, living in mangrove wood for months at a time.

A team of U.S. and English scientists accidentally discovered the unique behavior, which they call "logpacking," during recent excursions to Belize and Florida.

They were studying how the mangrove rivulus—an animal already infamous for its bizarre sexual behavior—survived the frequent dry spells that strike its swampy forest habitat.

"One of us kicked at a log, which broke apart and out came the fish!" said team leader Scott Taylor of Brevard County, Florida's Environmentally Endangered Lands Program.

Related: These Sea Spiders 'Breathe' Through Their Legs Watch: The sea spider uses its guts, not its heart, to pump oxygen through its body.

Log-Dwelling Fish

The mangrove rivulus, also known as the mangrove killifish, is native to the Americas and is about two inches (five centimeters) long.

The fish has long been studied for its many unique features.

It's the only vertebrate known to naturally self-fertilize, for example. In some populations, it can become a hermaphrodite, developing both male and female parts simultaneously, to produce clones of itself.

The animal can also live out of water for up to 66 days, Taylor said, and is one of very few fish species that spend their entire lives in mangrove swamps. Most fish move in and out of the areas as water sources dwindle.

Taylor and his team had previously found that when small pools of water dried up, the rivulus settled into crab burrows. But even those disappear during extreme dry spells.

"Sometimes the pools have very heavy [rivulus] populations, and they have to go somewhere when they dry," he said. "We had seen them under logs and in piles of damp leaves, inside coconuts, even in beer cans—for real."

But the researchers were extremely surprised to find the fish jammed together in tree remains, which quickly get hollowed out by termites or burrowing beetles in mangrove forests.

"It now appears that another option for emersion—the behavior of leaving the water—is to enter logs," Taylor said. "We now suspect that logs may be foci for these emersed pool populations."

The research will appear in an upcoming issue of the journal American Naturalist.

"Exceptional" Extremophile

Meanwhile, lab experiments by Patricia Wright, a biologist at the University of Guelph in Ontario, are helping to explain the unusual inner workings of the fish.

Wright has long been fascinated by the animal's extremophile nature—it's ability to survive in extreme circumstances. In addition to its long stints in air, the fish shrugs off large variations in water temperature, pH, salinity, oxygen level, and even the level of pollutants.

It's an "exceptional animal," she said. "It's able to survive in air for a long period of time without going into an altered metabolic state such as a lungfish might."

Her studies suggest that the animals can breathe cutaneously—through their skin—as long as they remain in a moist environment. To increase the time they can do this, the fish fill their gill systems with a mass of cells.

"Otherwise, the delicate [gill] plates would collapse and fuse together," she said.

Wright has also found surprising changes in how the fish deal with waste. Normally, fish excrete waste products such as nitrogen through their gills, but her experiments show rivulus use their skin for this as well.

"They have very thin skin, and you can see this very dense capillary network," she said.

Puzzles Abound

The logpacking find raises many questions, study leader Taylor added. For example, rivulus don't normally like each other.

"[They are] very aggressive to each other in aquaria and also apparently in the field, but they pack together in many numbers without aggression [in logs]," he said. "So it appears that during emersion this behavior ceases."

He speculates that the logs might serve an additional purpose—acting as cheap transport when storms send the wood drifting. But finding out for sure will require additional research.

"Ferreting out [the fish's] natural history and field behavior has been a real challenge, and that work is far from over," he said.

That's compounded by the fish's bizarreness, which has led to "looking in all the wrong places," he added.