(CNN) During World War Two, soldiers learned to fear treatment as much as enemy bullets. Unsanitary conditions and equipment in field hospitals made open wounds a breeding ground for bacteria that killed thousands, particularly the fast-acting and barely detectable gram-negative strains that caused toxic shock syndrome, meningitis, and typhoid.

Today, vast improvements in medical hygiene have greatly reduced the odds of patients being poisoned on the treatment table. And our safety is protected by an unlikely source -- the bright blue blood of the horseshoe crab.

The helmet-shaped creature has developed a unique defense to compensate for its vulnerability to infection in shallow waters. When faced with toxins produced by bacteria, amebocyte cells in the blood -- colored blue by their copper-based molecules -- identify and congeal around the invading matter, trapping the threat inside a gel-like seal that prevents it from spreading.

Nature's method is now utilized on a grand scale. Over 600,000 crabs are captured each year during the spring mating season, to "donate" around 30% of their blood in a handful of specialist facilities in the United States and Asia. The blood is worth $60,000 a gallon in a global industry valued at $50 million a year.

An extract has been used in the industry-standard limulus amebocyte lysate (LAL) contamination test since the 1970s -- replacing a rabbit-based system. Forty-five minutes of exposure to the crab's blood is enough to reveal endotoxins from gram-negative bacteria which otherwise avoid detection, and is sensitive enough to isolate a threat the equivalent size of a grain of sand in a swimming pool. The U.S. Food and Drug Administration (FDA) requires that intravenous drugs and any medical equipment coming in contact with the body must first pass through the crab's blood, from needles to surgical implants including pacemakers. As a result, thousands more of us survive such procedures.

The method is established but undergoes constant improvement, according to John Dubczak, General Manager at Charles River Laboratories , which manufactures and globally distributes LAL products.

"Detection is down to one part per trillion," he said. "But we can take it down to a tenth of a trillion, and further orders of magnitude more sensitive."

Charles River has adapted the system into a more resource-efficient, handheld kit requiring as little as 5% of the blood solution. Such systems can be applied outside the lab and break new frontiers, such as on a trip the International Space Station.

JUST WATCHED Can this cure cancer? Replay More Videos ... MUST WATCH Can this cure cancer? 04:39

"The test was used to determine if certain types of bacteria were present on various space station surfaces," said Norman Wainwright, the facility's director of Research and Development. Further, the system could "help perform biological studies necessary for an extended human presence in space, from crew health and spacecraft environmental studies to the search for life elsewhere in the solar system."

The blood is finding other uses on Earth too. Japanese scientists have devised a test for fungal infections with it, and further research is developing anti-viral and anti-cancer treatment through the same principle of isolating and trapping threats.

As the applications and their value multiplies, efforts have increased to develop alternative tests, rather than rely on harvesting the crabs. One approach uses an electronic chip that provides an alert when in contact with contaminants. Another system using liquid crystals, developed by the University of Wisconsin-Madison , could offer similar detection ability at lower cost.

"The (Wisconsin) literature claims to surpass the sensitivity and specificity for finding toxins, so false positives are not a serious problem," says Dr. Peter B. Armstrong, a professor of molecular and cellular biology at the University of California. "But nothing has gone to the level of FDA approval to show it is yet a viable alternative to LAL test. Knowing the cost and difficulty of obtaining FDA tests, it may be some time before any alternative is out there on the market."

The urgency may increase with reports of horseshoe crab numbers declining, for a variety of reasons, with the world's largest population in Delaware Bay reportedly reduced by between 75% and 90% in the last 15 years . Although there are welfare procedures in harvesting the blood, between 10-30% of donor crabs die in the process. One recent study showed that survivors are also impaired after release and often incapable of mating, further threatening the population.

"It's difficult because the blood is crucial for human health issues but the biomedical industry needs to keep the population steady," says Christopher Chabot, a biology professor at Plymouth State, who led the study. "We suggest decreasing the time they are out of water, and maintaining an ambient temperature for transportation ... there is a lesser mortality rate if you keep them cool."

Ultimately, Chabot believes an alternative is necessary to reduce the strain on the population, through both conservation programs and the development of a synthetic substitute. It is not clear what expiry date there is on the lifesaving services of the horseshoe crab, but without it medicine faces a return to the dark ages.