Animal rights groups have sharply criticised Berlin's zoo, saying the way the polar bear Knut was raised and held in captivity could have led to his death at such a young age.

The 4-year-old bear collapsed and died in his enclosure in front of a 600-strong crowd of visitors at Berlin Zoo at the weekend.

Witnesses said he suffered a series of convulsions and appeared to have an epileptic fit or a heart attack.

As veterinary surgeons prepared to conduct a post-mortem examination, animal rights groups alleged the zoo bore substantial blame for the bear's untimely death. They said polar bears could live up to 40 years in the wild.

Wolfgang Apel, the head of Germany's animal protection association, said although polar bears were essentially loners, Knut had been obliged to live with female bears because the zoo had ambitions for him to mate.

"Knut was under stress. His short and distressful life shows us yet again that polar bears do not belong in zoos, even if they are called Knut," he said.

The animal rights group Peta accused the zoo of keeping Knut in too small an enclosure and said the bear was predestined to suffer from behavioural abnormalities because he had been raised by a zookeeper. Berlin Zoo denied the accusations.

Knut was born in 2006 to a bear who rejected him at birth. He was hand-raised by his keeper at Berlin Zoo. He earned Berlin Zoo about €5 million ($9.7 million).

More than 15,000 Knut fans have so far paid tribute to him on Berlin Zoo's website.

Hundreds more have flocked to the zoo in person to lay flowers at his enclosure. "A friend has left us," said Gabrile Thne, the zoo's business director.