If you can’t stand the heat, get out of the water. That’s one fish’s strategy, anyway. New research shows that the mangrove rivulus fish (Kryptolebias marmoratus) flings itself onto land when the water gets too hot.

Plenty of fish split their time between surf and turf. Amphibious fish like K. marmoratus and the mudskipper can breathe and scoot around in the water and on land, which gives them an advantage when conditions in either place become uncomfortable or dangerous. 

But even among its weird amphibious brethren, the mangrove rivulus fish is unique. The little fish, which can be found in waters from Florida to Brazil, holds the record for the longest time spent on land. Researchers in South America found K. marmoratus living on land for up to 66 days at a time in crab burrows, beer cans, and even hollow logs. 

“We kicked over a log and the fish just came tumbling out,” one researcher memorably told Reuters

Getting out of the water can be tricky with no arms or legs, but K. marmoratus has it down to a science. The fish flings itself upward like an acrobat and flips, end over end, eventually landing on its belly. From there, it wriggles into a comfortable spot.

Why do they do this? For the same reason we jump into a swimming pool: to cool off. Researchers at the University of Guelph discovered that the fish leave the water when it gets too warm. In a paper published this week in Biology Letters, the scientists reported that the body temperature of an overheated fish drops within a few seconds of the fish leaving the water. It’s called evaporative cooling: as a fish’s wet skin dries, its body temperature drops.

This self-propelled air conditioning is an impressive and important adaptation for the fish, which live in waters that regularly reach 100.4°F.

“If the fish are prevented from jumping out of the water, they would die,” lead author Patricia Wright said this week in a press release.

Wright and her colleagues also found that, given a few days to acclimate, K. marmoratus quickly adapts to warmer water. This will serve the fish well as climate change dials up the heat in waters worldwide.

The ability to adapt is vital in an age of rapidly changing environments. K. marmoratus’s methods may be unorthodox, but they work. In time, we may just find that the weird will inherit the Earth.