Hurricane Harvey and its aftermath have been unprecedented: Trillions of gallons of water have rained down on Texas, displacing tens of thousands of people. So much water has fallen that the National Weather Service even had to add two new colors to its precipitation charts to account for the totals. And the rain is still falling.

But all that water is displacing more than just people. As Karin Bruillard at The Washington Post reports, any creatures without gills or flippers—snakes, alligators, deer and more—are seeking higher ground. One of the most dangerous refugees from the floods, however, are floating rafts of stinging fire ants.

These ants first came to the U.S. from Argentina about 75 years ago, spreading through Alabama, Mississippi, Texas, Florida and even California, Elizabeth Pennisi wrote for Science in 2011. Without natural predators they have spread aggressively and in densities 10 to 100 times greater than in their native range. The ants sting up to 5 million people per year in the U.S. with their painful, itchy venom, sending 25,000 people to the hospital each year.

But the strangest, and right now scariest, trick the ants have is their ability to glom together into giant floating rafts composed of up to 500,000 wriggling critters to survive floods.

Pro tip: Don't touch the floating fire ant colonies. They will ruin your day. #Harvey pic.twitter.com/uwJd0rA7qB — Mike Hixenbaugh (@Mike_Hixenbaugh) August 27, 2017

“Fire ants are capable of building what we call ‘self-aggregations,’” David Hu, biomechanics researcher at Georgia Tech, told Smithsonian.com in 2013. “They can build little boats, little houses called bivouacs and even bridges to cross streams by being the building material, linking their bodies together and forming strong networks.”

But it was only in the last few years have researchers teased out exactly how the tiny creatures create these floating rafts. It turns out that each ant in the writhing mass grips one another with all six legs. "A single ant can have up to 20 of its comrades' legs grabbing its body," Rachel Nuwer wrote for Smithsonian.com in 2014.

But the critters don't closely cling to one another. Rather, they push away to create air pockets that keep the rafts afloat—a process helped along by their waxy coating, reports Matt Simon for Wired. The queen and eggs remain in the center of the raft where it’s driest.

​The ants will float in these living mats for days or weeks until they hit a dry surface, writes Simon. Then they spread out on the area—whether it's a telephone pole, tree or your leg.

“The unfortunate thing is they don't care what it is that's dry,” Wizzie Brown, a program specialist the Texas A&M AgriLife Extension Service tells Simon. “So if it’s a house that they hit and there are people on the roof stranded, they will go up there as well because that’s them trying to escape the flood waters.”

As Eric Chaney at the Weather Channel warns, the ants can remain a problem even after the floodwaters recede. It's easy to accidently happen upon hordes of the critters, hunkered down amongst the debris. According to the Imported Fire Ant Research and Management Project, “Laundry piles are convenient places that present lots of tunnels for the ants. They may be attracted to moisture or food residue or oils on soiled clothing. Often, reports of ants in laundry occur following a flood.”

So what should you do if you encounter a mat of floating ants? Paul Nester, also from the extension service, tells Katherine Shilcout at Houstonia magazine that anyone venturing into the flood waters should wear rubber boots, cuffed gloves and protective rain gear so ants can’t get on their skin. “If you are in a row boat, do not touch the ants with the oars since they can ‘climb aboard’ via the oars,” he says.

If ants do get on you and start biting, he suggests rubbing them to get them off. As Ellen Airhart at Popular Science reports, spraying the ant rafts with soapy water prevents them from capturing air bubbles, causing the ball of creatures to submerge. But if you see a writhing mass of floating ants, the best solution (if possible) is to keep your distance.