Talk about survival instincts.

A goldfish that was meant to be fish food found a hideout and lived in a tank with its predator for seven years, according to Japanese news reports.

The goldfish was tossed into the tank of an arapaima, a massive, predatory fish native to South America. But instead of going quietly to its fate, the plucky goldfish swam into a filtration unit in the tank at Japan's Shima Marineland aquarium. Workers discovered the lurker after a routine cleaning.

Though it sounds far-fetched, the goldfish's survival in such a strange environment is not all that surprising, said Sudeep Chandra, an aquatic ecosystems researcher at the University of Nevada, Reno. [Photos: Thousands of Goldfish Swarm in Colorado Lake]

"Goldfish and their related cousins are generally very hardy species that can survive under various conditions," Chandra told Live Science.

Predatory fish

The goldfish was originally intended to be fed to the arapaima, which are among the biggest freshwater fish in the world, with some reaching a whopping 484 pounds (220 kilograms). In the wild, arapaima inhabit the tributaries and drainage waters of the Amazon and Orinoco rivers. Because they live in oxygen-poor waters, the fish have evolved the ability to breathe air, staying submerged for just 10 to 20 minutes at a time. That has made them easy marks for fishermen with harpoons, and the creatures have been hunted to the brink of extinction in some parts of Brazil.

Arapaima are somewhat omnivorous creatures that will hunt small fish, crustaceans and insects, though scraps of plant matter have also been found in their stomachs, according to an article on Ornamental Fish International. However, they can adapt to a fish food diet in captivity, Caroline Arantes, a doctoral candidate in ecology, evolution and systematic biology at Texas A&M University in College Station, said in an email.

Escape plan

The arapaima at the Japan aquarium was fed live fish, such as the goldfish, but switched to more traditional fish food at least seven years ago. It's not clear whether the goldfish was hiding the entire time in the filtration system, but to get into that hiding spot, the goldfish needed to swim through a long pipe. Either way, it clearly had access to bits of food that passed into the filtration system, as it had grown to an impressive 10 inches (25.4 cm) long, according to The Register.

Though the goldfish's seven-year stay in the filtration system seems exceptional, the goldfish could have kept up its stealthy existence even longer if cleaners had not discovered it, Chandra said. Goldfish typically live between 10 and 15 years in captivity, though the world's oldest goldfish was 43 years old when he died peacefully in 1999, the BBC reported.

"The water pipe had warm water and constantly flowing water bringing oxygenated water to the fish. As long as food was delivered, I imagine the fish could persist for even longer," Chandra said.

Now, the survival-minded goldfish has gotten a promotion and is the star attraction at the aquarium, the Register reported.

Goldfish aren't quite the aquatic equivalent of cockroaches, but they're close. A few years ago, Chandra and his colleagues discovered monster-size goldfish in Lake Tahoe. The goldfish had been tossed into the lake from an aquarium and had grown to a whopping 4.2 lbs. (1.9 kg) and 1.5 feet (45.7 cm) long. And in the Canadian province of Alberta, officials are urging people not to flush goldfish down the drain and are considering labeling the humble childhood pet an invasive species, after several individuals "the size of dinner plates" emerged in local storm ponds, CBC News reported.

Follow Tia Ghose on Twitter and Google+. Follow Live Science @livescience, Facebook & Google+. Original article on Live Science.