Copenhagen Zoo shot an 18-month-old giraffe Sunday morning, despite efforts of several zoos and an online petition condemning the cold act.

The zoo said that it had to put down the young giraffe -Marius- to prevent in-breeding, BBC reported.The zoo said that it didn't give the giraffe contraceptives because they damage internal organs of the animal.

The giraffe was killed by a bolt gun and was later dismembered in front of a large audience, which included children. The carcass was then fed to lions.

Stenbaek Bro, zoo spokesman, defended the public feeding of Marius by saying that it helped children learn something new. He added that parents were allowed to choose whether they wanted children to see the giraffe being cut and fed to the lions.

"I'm actually proud because I think we have given children a huge understanding of the anatomy of a giraffe that they wouldn't have had from watching a giraffe in a photo," Stenbaek Bro said in a telephone interview with The Associated Press.

A Question and Answer segment posted on the zoo's website explains why the authorities chose to kill the animal.

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

Before the death of the giraffe, an online petition collected more than 20,000 signatures to save Marius. Several zoos, including the U.K.'s Yorkshire Wildlife Park, said they had the resources to accommodate an extra male giraffe, BBC reported.

The Copenhagen Zoo is part of the European Association of Zoos and Aquaria, which works to conserve biodiversity and ensure high-quality care for animals in zoos.