Douglas the parrot, who appeared in a popular children's film about the adventures of Pippi Longstocking, has died at the age of 51.

Douglas, a male scarlet macaw, was unfazed by both celluloid fame and playing the female role of Rosalinda, a member of a gang of pirates who capture Pippi's father Captain Efraim Longstocking in the 1970 film Pippi in the South Seas, Dagens Nyheter newspaper reports.

Matthias Reinschmidt, the director of Karlsruhe Zoo in Germany, said Douglas had died of old age, while resting on his arm.

Pippi Longstocking is the young heroine of a series of books by Swedish author Astrid Lindgren, which have been adapted for the small and big screen many times.

After his moment in the limelight, Douglas went on to settle in an enclosure at the Folk Park in Malmö, but peace was to elude him in Sweden.

'Huge outcry'
Back in 2003, the authorities decided that he would have to be put down, for lack of the proper paperwork to show that he had been imported legally from Brazil.

This caused a "huge outcry", as Karlsruhe Zoo recalled on Facebook, and 50,000 people - including Pippi Longstocking actress Inger Nilsson - signed a petition to spare his life.

As luck would have it, a former owner was able to prove that Douglas was a legal immigrant, and he lived to fly another day.

But the Swedish Board of Agriculture later ruled that the Malmö aviary was too small, and it looked like Douglas might face death once again before dozens of zoos offered him a new home.

He moved to Karlsruhe in May 2016, to be welcomed by the city mayor and a children's choir. He went on to became one of the zoo's chief attractions.

'True friendship'
Douglas is fondly remembered by all the zoo staff who cared for him.

His old keeper in Malmö, Frank Madsen, said Douglas had a vocabulary of 50 words, and his handler in Karlsruhe, Maria Rüssel, remembered him as a "great character" with whom she developed a "true friendship".