(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

Photos: In pictures: Invasive species around the world Northern Pacific Seastar – Growing up to half a meter in width, the Northern Pacific Seastar (also known as the Japanese Starfish) has spread from the North Pacific to the south coast of Australia. A single female can carry up to 20 million eggs. It's just one of the invasive species that are traveling to new environments and harming native ecosystems. Scroll through the gallery to see more of the planet's most problematic invasive species. Hide Caption 1 of 12 Photos: In pictures: Invasive species around the world Warty comb jelly – The humble comb jelly has no brain, stomach or bones. It eats microscopic sea organisms, as well as fish eggs and larvae. Native to the Atlantic coasts of North and South America, warty comb jellies reached the Black Sea, Aegean Sea and Caspian Sea during the 1980s. The jellies traveled across oceans in the ballast water of ships. In these new waters, they flourish thanks to a lack of natural predators. It is associated with crashes in fish numbers. Dolphin populations, dependent on fish supplies, have plummeted in the Black and Azov Seas as a result of the jelly invasion, according to the World Wildlife Fund. Hide Caption 2 of 12 Photos: In pictures: Invasive species around the world Asian Longhorn beetle – Trees where these beetles lay their eggs are doomed to a slow death, as larvae gnaw away at their bark from the inside. Native to Asian countries including China and Japan, this species has reached Europe and North America, mostly through wooden packaging. They have already infested many poplar plantations in China, and have also been found in chestnut trees, willows and elms. The US Department of Agriculture has warned that the insects could devastate American timber industries and forests if left unchecked. Hide Caption 3 of 12 Photos: In pictures: Invasive species around the world Cane toad – These creatures are indigenous to South America. They were deliberately introduced to many countries in the 1930s (including the USA and Australia) to help control sugar cane pests, like beetles. But cane toads proved to be disastrously voracious, eating anything from honeybees to dog food. An estimated 1.5 billion cane toads live in Australia alone. When attacked or eaten, they emit venom that can be fatal to wild animals and household pets alike. Studies in Bermuda show they are outcompeting native frogs. Hide Caption 4 of 12 Photos: In pictures: Invasive species around the world Stoat – Related to weasels, polecats and ferrets, the stoat is a small but ferocious predator. Stoats have no qualms about attacking larger animals, including rabbits and chickens. European settlers took stoats to New Zealand for pest control purposes, where they wreaked havoc on native bird populations. The New Zealand Government spends millions of dollars each year protecting native birds from stoats, which feast on their chicks and eggs. Hide Caption 5 of 12 Photos: In pictures: Invasive species around the world European Starling – Sixty of these birds were set free in New York in 1890, in a bizarre plan to introduce to the USA every bird mentioned in a Shakespeare play. European Starlings were also deliberately introduced to regions of Australasia and South Africa to control native insect populations. Today, between 100 million and 200 million Common Starlings on six continents destroy many crops, and out-compete birds like woodpeckers in the United States and black cockatoos in Australia. However, their numbers appear to have fallen in recent decades, possibly due to intensive farming techniques. Hide Caption 6 of 12 Photos: In pictures: Invasive species around the world Giant African land snail – Its native range is coastal East Africa, but this snail has reached all continents except Antarctica. They are sold as food, pets, and for medicinal purposes, which led to their accidental introduction to the wild. In New Zealand, the Giant African land snail eats many types of local snails, as well as native plants. Hide Caption 7 of 12 Photos: In pictures: Invasive species around the world Red deer – This large deer species was brought from Europe and Western Asia to Australia, New Zealand and South America, for trophy hunting and livestock. It flourishes in a wide range of habitats and can outcompete native mammals searching for food. Hide Caption 8 of 12 Photos: In pictures: Invasive species around the world Common prickly pear – Originally from the Americas, this cactus is an invasive species in South Africa, Kenya and Australia. It grows in bristly thickets up to two meters high, and was often introduced to contain livestock. It is highly drought resistant and frost resistant, and can spread across millions of hectares of land. During an infamous spell dubbed "the green hell" in Australia in the 1920s, the cacti spread so rapidly and thickly across rural plains that people abandoned their homes and farms. The plants were tamed when authorities introduced a foreign cactus gourmet, the cactoblastis moth, in 1925. Hide Caption 9 of 12 Photos: In pictures: Invasive species around the world Black rat – Also known as the ship rat, it is native to India but over thousands of years, it spread to every continent except Antarctica by hiding in ships. These furry stowaways can devastate wildlife populations as they guzzle through native insects, bird eggs and chicks, and fruit. Hide Caption 10 of 12 Photos: In pictures: Invasive species around the world Water hyacinth – These purple-blossoming plants can spread to cover every inch of a lake, blocking out sunlight and crowding out native plants. The water hyacinth most likely originated in Brazilian rainforests, and became a popular addition to garden ponds worldwide in the 1890s. But this formidable species can double its size in a fortnight. The flowers are now found in most of the United States, and on every continent except Antarctica. Hide Caption 11 of 12 Photos: In pictures: Invasive species around the world Big-headed ant – The big-headed ant first spread from southern Africa via ships during the 18th century. They are now found in both tropical and temperate regions, from Japan to Puerto Rico. They chew through electric wires as well as seeds, aphid honeydew, and other insects. As they graze, the ants can spread viruses among crops. Native spiders and weaver ants also struggle when this species infests new land. Hide Caption 12 of 12

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."

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.

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."

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."