A healthy young giraffe has been put down at Copenhagen zoo, despite a campaign to save it.

Protesters carrying banners gathered outside the zoo this morning and thousands of people signed a petition to rescue the giraffe, called Marius, after the Danish zoo announced it was planning to kill the animal because of European laws on inbreeding.

A zoo vet prepares to carry out an autopsy on Marius. Photograph: Kasper Palsnov/EPA

Other zoos, including the Yorkshire wildlife park in Britain, had offered to take it in.

But according to the Danish newspaper BT, Marius was fed some rye bread at 9.15am and was killed shortly after by a shot in the head with a bolt gun.

Children watch the autopsy at Copenhagen zoo. Photograph: Rasmus Flindt Pedersen/AP

Live footage of his body being dissected was streamed by Ekstra Bladet, showing zoo workers wearing green rubber gloves carrying out the dissection while an announcer guided the crowd through the process and fielded questions. Some of the meat was later fed to lions at the zoo.

The zoo defended the decision to slaughter Marius, saying that to send the giraffe to another zoo would also risk problems of inbreeding. It said Marius's genes were already well represented among giraffes at the zoo.

Lions eat the remains of the giraffe. Photograph: Pedersen Rasmus Flindt/AP

"We know we are doing the right thing," Bengt Holst, the zoo's scientific director, told Danish TV2. "The many reactions don't change our attitude to what we do. It's very important to us that we take responsibility throughout. We need to have as healthy a stock as possible so we avoid inbreeding."

Holst said some of the meat from the giraffe would be used for research and the rest for food.