Stay Updated on Developing Stories

The Guam rail was extinct in the wild for nearly 40 years. Now it's back.

(CNN) Almost four decades after completely disappearing from the wild, a bird that had survived only in captivity now roams freely on two tropical islands.

The Guam rail's native home is a remote, 212-square-mile island in the Pacific Ocean, half way between Australia and Japan.

Known locally as the ko'ko', the rail, which had been classified as "extinct in the wild," was promoted to "critically endangered" by the International Union for the Conservation of Nature's (IUCN) 2019 red list of threatened species. Only one bird -- the California condor -- has previously taken that crucial step back from the brink.

What happened to the Guam rail?

During World War II, the island of Guam was occupied by the Japanese military. Soon after the island was liberated by US forces in 1944, brown tree snakes appeared -- it is thought they hitched a ride there as stowaways on an American cargo ship.

For the predatory snakes, which grow up to eight feet in length, Guam was a food-filled paradise. As they feasted on the island's defenseless native animals, their population exploded, reaching peak density of 20 plus snakes per acre of jungle.

The voracious serpents wiped 10 out of 12 native forest birds off the island.

The killing of birds triggered a "domino effect" says Suzanne Medina, a wildlife biologist with the Guam department of agriculture, who has worked to save the Guam rail for 21 years. Without birds to spread tree seeds, the forests thinned out. Meanwhile, populations of spiders -- which had previously been kept in check by birds -- surged. Medina says that she no longer hears bird song when walking in the jungle, but she always carries a stick to clear spider webs -- "otherwise you'd be covered in them."

Read: She filmed sharks for 'Jaws' - then dedicated her life to saving them

The problem didn't stop there -- the snakes also slithered from trees to electrical lines, causing frequent power outages.

The brown tree snake is native to Australia, Indonesia, Papua New Guinea, the Solomon Islands and Melanesia -- but not Guam.

Strategies to eradicate the snakes have included setting traps and air-bombing dead mice laced with the painkiller acetaminophen, which is deadly to snakes, but the reptiles continue to wreak havoc.

Only a handful of Guam rails avoided being eaten. In 1981, conservationists captured 21 individuals -- all that they could find. They brought them into captivity and the bird was declared extinct in the wild.

Back to the wild

Eight years after the surviving rails were captured, conservationists started releasing captive-bred birds into the wild -- not on Guam, where they would likely be eaten, but on Rota, a small, snake-free island about 30 miles northeast.

But these early attempts failed, says Medina. The freed birds were run over by vehicles, or were eaten by feral cats, and they tended to spread out so widely that they couldn't find each other to breed.

It was only in the late 1990s that Medina and her team "discovered the secret to captive breeding," she says.

Success hinged on getting to know the birds' personalities. "We spent a lot of time with the birds -- we were basically living with them," she says.

This Guam rail was released on Cocos Island.

Some male birds showed no interest whatsoever in mating, even if the females were ready and willing, says Medina's colleague, Laura Duenas, who has worked on the project for nearly a decade. Some prospective mates would fight and, in the worst instances, kill each other.

The team compiled a file on each breeding adult, noting which seemed willing to mate and which might require coaxing. They fine-tuned the process of choosing mating pairs on the basis of both genetic information and personality.

Find out more about Call to Earth and the extraordinary people working for a more sustainable future

Their efforts paid off. More chicks hatched and prospects improved. Rota is now home to 200 Guam rails and a further 60 to 80 live on Cocos Island, a tiny atoll off the southern tip of Guam, where releases have taken place since 2010. The numbers aren't huge but "we're confident this population is sustainable," says Duenas.

Spark of hope

The Guam rail was one of 10 species -- eight birds and two fish -- that received a status upgrade on the IUCN's 2019 red list. In a press release, the organization's acting director Grethel Aguilar said the news "offers a spark of hope in the midst of the biodiversity crisis" and proves that "nature will recover if given half a chance."

Read: Wildlife is thriving in these former war zones

The biodiversity crisis is a growing problem, though. The red list also includes more than 30,000 animals and plants that are judged to be at risk of extinction.

For the Guam rail future looks relatively secure. Medina and Duenas hope to release rails on Guam in the next two years, in areas that are currently being cleared of snakes. "I would love to see the ko'ko' back in the wild on Guam," says Medina. "Most importantly, I'd like my son and all the children of Guam to be able to see them too."

Outbrain