There were no Scooby snacks to eat – but at least they had each other for company. Two goldfish, named Shaggy and Daphne after characters from the animated television show Scooby Doo, have become the smallest survivors of the devastating earthquake in Christchurch that killed 181 people in February.

The fish spent four and a half months trapped in their tank in the city's downtown area, which was made off-limits after the quake. The creatures had no one to feed them and no electricity to power their tank filter before they were discovered and rescued.

"It's certainly an incredible story. I wouldn't have guessed that fish could survive on their own for four months," said Paul Clarkson, curator at the Monterey Bay aquarium in California. "Goldfish are very hardy critters."

Luckily for the fish, they lived in a large 26-gallon (100-litre) tank and had seaweed to munch on. According to Clarkson, the fish may also have gleaned some nutrition from eating algae growing on the tank's rocks and walls. He said naturally growing bacteria may have helped keep the water clean enough to sustain life.

There were six goldfish in the tank when the earthquake struck, but by the time the survivors were found, no trace remained of three of the fish. A fourth was found floating in the tank. Goldfish are, after all, omnivores.

The fish had been on display in the reception area of Quantum Chartered Accountants on Christchurch's high street. Company director Vicky Thornley said she was about to step into the elevator when the quake hit and she grabbed on to the wooden tank surround, to steady herself and stop the tank from falling.

"I was clinging on for dear life," she said. She and her three co-workers made it out of the building as masonry and bricks crashed through a skylight. Thornley's first thoughts were for the safety of her 5-year-old son, Joshua, who was unharmed.

It wasn't until 6 July that authorities finally allowed her back into the office, escorting her to collect belongings. Her office was in a particularly hard-hit part of the city.

Thornley said she didn't want to look in the direction of the tank because she was sure the fish would be long dead. But Thornley was astounded when an earthquake recovery worker shouted to her: "Hey there are fish here, and they're alive!"

The fish looked dull in colour but otherwise appeared fine, Thornley said. She scooped them out and took them home in a bucket. She gave them to Joshua, who loves goldfish and already had two of his own, Scooby and Fred. It was Joshua who then named the survivors.

Thornley said she was nervous about putting Shaggy and Daphne in with her son's fish, given that they may already have developed a taste for their own kind. But nothing happened and all four are now swimming happily together in a new tank.

Although none survived as long as Shaggy and Daphne, hundreds of pets were rescued within the first two weeks of the quake. Carolyn Press McKenzie, who runs the Huha animal sanctuary in Wellington, said she has since found homes for most of the 115 dogs, cats, roosters and turtles she helped rescue from Christchurch.