Outcries on social media and an online petition that drew more than 27,000 signatures failed to save a healthy young giraffe killed Sunday in accordance with the Copenhagen Zoo's inbreeding policy.

The zoo said it killed the 18-month-old male giraffe named Marius and fed him to lions and other zoo animals to keep the giraffe population "genetically sound." Bengt Holst, scientific director at the Danish zoo, told the BBC that giraffes had to be selected to make sure the best genes were passed down, ensuring long-term survival.

He said it was a zoo's responsibility to manage animal populations to ensure they remained healthy, adding that 20 to 30 animals are put down at Copenhagen Zoo in a typical year.

"Giraffes today breed very well, and when they do you have to choose and make sure the ones you keep are the ones with the best genes," Holst told the BBC.

Marius was killed by a bolt gun instead of a lethal injection, which would have contaminated the meat, The Copenhagen Post reported. Most of the corpse was fed to zoo animals. Part of his carcass was designated for scientific research. Visitors to the zoo on Sunday were even invited to attend the autopsy.

Maria Evans, who created the online petition, told the Post that the zoo produced Marius, so it was the zoo's responsibility to find him a home. "They must not be allowed to take the easy option," Evans said.

Stine Jensen, from Denmark's Organization Against the Suffering of Animals, told the BBC the group's offer of help, along with many others from across Europe, was turned down.

Animal rights campaigners have described the move as barbaric and have accused the zoo of being unethical. The director of a wildlife park in the Netherlands, Robert Krijuff, whose last-minute offer of a place was also rejected, said: "I can't believe it. We offered to save his life. Zoos need to change the way they do business."

England's Yorkshire Wildlife Park said it also made an unsuccessful bid to save Marius, adding that it was "saddened to hear reports from Copenhagen that 18-month-old giraffe Marius has been euthanized."

But Holst told the BBC that all zoos had been considered and there was no place for Marius. He said any space at Yorkshire should be reserved for a genetically more important giraffe. The campaign to save Marius, he said, had gone "much too far."