A rare blue parrot that was among the last wild-born members of its species and was believed to have inspired the movie Rio has died outside São Paulo, Brazil.

The bird was a Spix's macaw named Presley, and he was around 40 years old when he died Wednesday. He was thought to be the second-to-last of the remaining wild-born parrots.

Presley's death is a blow to conservation efforts in both a symbolic and literal sense. Critically endangered, these native Brazilian birds (Cyanopsitta spixii) are believed to be extinct in the wild. Decades of deforestation and rampant wildlife trafficking have besieged the medium-size macaws, who also ended up having to compete for nest space with introduced Africanized honeybees.

Now, the fewer than 100 remaining Spix's macaws are cloistered in captive breeding programs and refuges throughout the world—and the small population is vulnerable to genetic defects caused by inbreeding. Presley offered the opportunity to inject some much-needed genetic diversity into the population.

But he left no offspring.

There are reports that Presley himself influenced the 2011 movie Rio, an animated film that tells the tale of a lone male Spix's macaw. Found living in the United States, the bird, named Blu, is initially unable to fly. But he returns to Brazil and finds the only other known surviving member of his species, a female named Jewel. Together, the two movie macaws battle wildlife traffickers and eventually start a small family.

Director Carlos Saldanha has said he hoped the movie would raise awareness of the challenges facing endangered birds in Brazil. "I wanted [to feature] the rarest bird," he told the website Bird Channel in 2011. "The Spix's macaw truly is the rarest."

View Images The 2014 film Rio 2 continued to tell the story of a Spix's macaw named Blu, at left. PHOTOGRAPH BY 20TH CENTURY FOX/ BLUE SKY STUDIOS VIA AP

Released this year, an optimistic sequel, Rio 2, follows Blu and Jewel as they encounter a hidden population of Spix's macaws in the Brazilian Amazon.

Saldanha did not respond to requests for comment.

Presley’s story shares many similarities with Blu’s first chapter. More than a decade ago, Presley rose to fame when he was improbably found living in Colorado. Like so many of his kin, the bird had been smuggled out of his native Brazil in the 1970s, just as governments were beginning to regulate illegal wildlife trade. From his birthplace in the São Francisco Valley in northern Bahia, Presley traveled through several private bird collections in Europe before ending up in the American West.

During his years abroad, Presley's macaw kin vanished from Brazil's forests, with the last known wild Spix's disappearing in 2000.

In 2002, parrot enthusiast Mickey Santi answered the phone at the veterinarian's office where she worked. On the other end was a caller with a question about her captive Spix's macaw.

Skeptical of the caller's species identification, Santi went to visit the woman—and found Presley sitting in a small cage. He wasn't in great shape, and couldn’t fly. After six months of rehabilitation, Presley returned to Brazil via the San Diego Zoo, where geneticists collected a small sample of the bird's DNA.

Once in Brazil, Presley lived in the São Paulo zoo for several years. In 2006, he moved to the Lymington Foundation, a privately owned refuge and breeding facility for rare parrots in the forest outside São Paulo.

"He was very affectionate–just a very congenial bird, very chirpy, very talkative. He loved visitors," says Bill Wittkoff, Lymington's executive director. "He's got an aviary that we'd wheel in and out, for the cold in wintertime and because of very, very hot sun. We'd go by his aviary often and he'd always gives us a chirp, a hello."

Many parrots need the company of other birds to thrive. Bill Wittkoff and his wife Linda, Lymington's director, first tried to breed Presley with a female Spix's named Flor; the pair produced a bunch of eggs, but the eggs were all sterile. When Flor was transferred to a different breeding program, a new friend—Killer, a Golden Conure—kept Presley company. When Killer died, Presley's new partner was Priscilla, a Vinaceous Amazon parrot.

Presley "was doing pretty well," says Linda Wittkoff. "His death came as a surprise."

Over the past year, health exams had revealed that Presley had an irregular heartbeat. When he suddenly lost his appetite late last week, the Wittkoffs took him to a university veterinary clinic in nearby Botucatu.

They'd hoped Presley would recover so he could move to a refuge closer to the clinic. The plan, they said, was for Presley to try artificially inseminating some of the female Spix's at the refuge, a procedure that hadn't been attempted yet.

Most captive Spix's macaws are closely related, and when such individuals breed, detrimental combinations of genes that would normally be eliminated are passed down. As a result, offspring are born with a host of problems, including increased disease susceptibility and infertility. Because he was unrelated to the females, Presley could have added some crucial genetic diversity into the mix.

But at 7 a.m. on Wednesday morning, Presley died, leaving the Wittkoffs without their cheerful survivor and the world without its best-known Spix's macaw. Linda Wittkoff says the veterinary clinic is working hard to preserve his reproductive tissues and genetic material, and save some of what he might have passed down.