(CNN) -- An online petition to save a healthy young giraffe from death has failed, despite thousands of signatures from animal lovers.
Copenhagen Zoo said it euthanized the male, named Marius, on Sunday because of a duty to avoid inbreeding.
After an autopsy, "Marius" was dismembered in front of a zoo audience that included children, and fed to the zoo's lions.
Despite online uproar over the move and reports of last-minute attempts to save the animal, the zoo in the Danish capital said it had no place for Marius in its giraffe herd.
"Our giraffes are part of an international breeding program, which has a purpose of ensuring a sound and healthy population of giraffes," Bengt Holst, scientific director at Copenhagen Zoo, told CNN. "It can only be done by matching the genetic composition of the various animals with the available space. ... When giraffes breed as well as they do now, then you will inevitably run into so-called surplus problems now and then."
CNN anchor Jonathan Mann asked Holst if it would have been possible to sterilize Marius or move him to another zoo to avoid killing him.
"If we just sterilize him, he will take up space for more genetically valuable giraffes," Holst answered.
Did the children watching cry? Mann asked.
Just the opposite, Holst said. The crowd was "very enthusiastic" and "the kids asked good questions."
Fed to the lions
The carcass was used partly for research and partly to feed carnivores at the zoo -- lions, tigers, and leopards.
"In this case we would never throw away 200 kilograms of meat," Holst said.
He said the giraffe was 2 years old, and while he was not officially named, his keepers had called him Marius to identify him.
The giraffe's impending death had sparked outrage online, with more than 27,000 people signing a "Save Marius" petition, appealing for a last-minute change of heart.
"The zoo has raised him so it is their responsibility to find him a home," author Maria Evans wrote on the petition site.
Copenhagen Zoo said that due to a massive debate on its Facebook page, it had published a Q&A about the decision on its website.
"It is not possible to transfer the giraffe to another zoo as it will cause inbreeding," it said.
Several zoos volunteered to take Marius in.
The UK's Yorkshire Wildlife Park, which says it has a state-of-the-art giraffe house and the capacity for an extra male, was among several places which put in offers to take him.
International breeding program
Copenhagen Zoo said only zoos that follow certain rules can be part of international breeding programs.
In Europe, these are members of the European Association of Zoos and Aquaria. The association counts just over 300 members and under its rules, inbreeding among giraffes is to be avoided.
The association said in a statement Sunday that it supports the zoo's decision.
Despite Marius being healthy, his genes are already well represented at the zoo. Releasing the giraffe into the wild would be unlikely to succeed, Copenhagen Zoo said.
Contraceptives "have a number of unwanted side effects on the internal organs and we would therefore apply a poorer animal welfare if we did not euthanize," it said.
It also made clear that its policy was not to sell the animals.
Holst told CNN the autopsy had been performed outside, given the giraffe's size, and watched by the public, including children if their parents allowed them to.
"It is a good opportunity to invite our guests to watch. ... We are here to educate people and that is a good way to show people what a giraffe looks like," he said.
"People could come into this area if they wanted to. They came with children, without children, we had a lot of people."
He said a group of about 16 protesters had gathered outside the zoo on Sunday morning and that he had tried to speak with them.
He said all options had been explored before the decision had been made.
"We have always been very open about it, explaining why we are doing it," he said.
On average, he said some 20 to 30 animals, including goats, antelopes and wild boar, were culled for the same reason every year at the zoo.
"This is the first giraffe. ... I do not understand the outrage -- we are all used to on a current basis of animals being culled in the wild," he said.
"We have to ensure a safe healthy population for the future, and you can only have a healthy population if you control and coordinate your breeding efforts."