Ants have many things in common with humans. They create complex societies with sophisticated hierarchies. They cooperate to get food. They go to war. And, it turns out, at least one species also drags its wounded off the battlefield, reports Nicola Davis at The Guardian.

In a new study published in the journal Science Advances, researchers detail the behavior of Megaponera analis, an ant species that roams throughout sub-Saharan Africa. The species specializes in waging war on termites and set out two to four times a day in raiding parties to grab a termite lunch. As Davis reports, the ants hunt cooperatively. The larger ants would crack open termite mounds while the smaller ones would rush in, killing termites to bring back to their nest for a feast.

But the termites are not defenseless, As Jason Bittel reports for National Geographic, they too have soldiers that fight back, nipping off ant heads, legs and antennae. Sometimes multiple termites sink their pincers into the ants, slowing them down so they get snacked on by waiting spiders. At the end of the battle, dead and injured ants are scattered across the battlefield.

The researchers studied the termite hunters in Comoé National Park, northern Côte d’Ivoire, tracking 52 colonies that set off on a total of 420 termite raids. And they found not all injured were left for dead. The results suggest that the injured ants release a pheromone from their mandibular gland, a type of S.O.S. signal that alerts their fellow ants that they need assistance. Other ants respond by helping remove attached termites and carrying them back home, allowing them to rest and recover.

“This [is] behavior you don’t expect to see in ants; you always imagine an individual ant as having no value for the colony and that they sacrifice themselves for the good of the colony,” Erik Frank of the University of Würzburg and co-author of the study tells Davis. The research, however, reveals that “the good of the individual is for the good of the colony in this case.”

In fact, according to the press release, it’s the first time researchers have observed invertebrates “helping” each other. But Frank is quick to point out that the battlefield medics aren’t saving their friends out of loyalty or empathy, they will aid anyone who emits the right pheromone.

According to Davis, the researchers nipped off the legs of 40 ants during raids. They found that the other ants saved their comrades only if they were from the same nest, leaving ants from other colonies to fend for themselves.

They also found that, when they prevented ants from being rescued, 32 percent of them died while dragging themselves back to the nest, mainly from being gobbled up by spiders. But 95 percent of the ants that were carried home and allowed to mend lived to fight again against the termites. “By saving these injured ants which participate again in future raids, they don’t have to replace them by producing new workers,” Frank tells Davis.

The researchers calculated that rescuing their comrades has a big benefit for the colony as a whole, allowing it be about 29 percent larger than it would be without the medical intervention. In fact, about 25 percent of the ants in the raiding parties showed signs of previous injuries.

Helen McCreery who studies ant behavior at the University of Colorado at Boulder tells Bittel the study is surprising, since she would have assumed the injured ants weren’t of much value to the colony. But the research shows that’s not the case. “[Rescuing the ants] increases the life span of those individuals, but more importantly in the context of evolution, it saves resources at the colony level,” she says.