On Sunday, one of the rarest birds in the world took wing from Denver, heading for Miami in a small cage wedged under a coach class seat on an American Airlines jet.

In a quiet corner of the Miami airport, officials handed the blue Spix's macaw to a Brazilian conservationist -- marking the conclusion of an extraordinary five-month effort by American bird enthusiasts, geneticists and government officials to bring the native Brazilian bird back from the brink of extinction.

The parrot was the only known Spix's macaw in the United States. Protected by international treaties, it was probably illegally snatched from Brazil at least 25 years ago and smuggled into the United States. High hopes are riding on its return to Brazil, because it promises to add a shot of healthy genetic diversity to Brazil's remaining collection of a few dozen inbred birds -- perhaps even saving the species from extinction.

The parrot was discovered by accident in Colorado when a woman from a Denver suburb called an avian veterinarian's office in August. Mischelle Muck, a parrot enthusiast, happened to answer the phone. The woman said she owned a Spix's macaw and asked for suggestions on how to take care of the bird.

Muck, knowing that bird owners sometimes made outlandish claims, was skeptical. The Spix's macaw was extinct in the wild, and there were only about 60 birds in captivity. Most were in a Brazilian breeding program. Although there had been rumors about a Spix's macaw somewhere in Colorado, Muck had long discounted them as gossip.

Muck got the woman, whom authorities have not identified, in touch with the World Parrot Trust, an international group of enthusiasts. James Gilardi, its director, immediately pushed for repatriating the bird to Brazil.

In August, after several phone conversations, the owner agreed to have Muck come to her suburban house outside Denver.

As soon as she entered, Muck saw a small cubic cage -- about two feet on each side. Then she saw the bird, and her heart skipped a beat. It was definitely a blue Spix's macaw.

For years, Muck had followed the fate of the vanishing species, which went extinct in the wild two years ago. Its numbers were decimated by smugglers, who snatched birds out of the rain forest and smuggled them to sell to wealthy collectors around the world. It's a trade that outrages animal lovers, and the sight of a Spix's macaw in a suburban American living room brought tears to Muck's eyes.

The owner has told authorities that the bird was left with her in the late '70s, and investigators believe she is a step or two removed from the smuggler. Special agent George Morrison of the U.S. Fish and Wildlife Service, who worked on the case, said the trail of the smuggler is now cold, although an investigation is still open.

Saying she was initially unaware that it was a rare bird, the woman paired it with an Amazon parrot. She named it Presley. Macaws are deeply social birds, usually mating for life, and the parrots grew attached. The Amazon parrot died this year, leaving the Spix's macaw deeply listless.

Since the parrot's origins were vague, the parrot experts could only estimate that the bird is between 25 and 50 years old. Gilardi said parrots can live for 50 or 60 years in captivity and are thought to be capable of breeding until death.

Muck noticed that the perches in the parrot's cage were too wide, causing the bird to stand flat on its feet instead of gripping. Its legs had grown weak, and its balance was poor. The woman had fed the bird regular commercial pellets; Muck knew that parrots need a richer diet. The woman also had trouble bathing the bird.

Over the next few weeks, as Gilardi worked with U.S. and Brazilian officials to return the parrot home, Muck began changing the bird's diet and giving it toys. Because of the ongoing investigation, everything was done in secret

Muck said she bought nothing from pet stores -- she didn't want to accidentally infect the Spix's macaw by bringing anything contaminated by other birds. Toys came straight out of crates shipped to wholesalers, seeds straight from the manufacturers. Many of the suppliers were Muck's friends in the birding community. They gave her supplies and asked no questions, even when she instructed them to wash before they touched the supplies.

"You need to go for a ride with me and bring your stuff," Muck once told a veterinarian, whom she took to see the parrot. "You need to shower before you come out."

Because it is difficult to visually determine a parrot's sex, a small number of feathers and a blood sample were shipped to the San Diego Zoo, where geneticist Oliver Ryder conducted DNA tests to determine that the parrot was a male. He also isolated some cells, multiplied them into millions, and preserved them in the zoo's frozen bank.

The cell culture is the only known frozen sample of Spix's macaw cells, and may one day open the door to new research -- perhaps even cloning -- if the species goes extinct.

In Colorado, Muck and Special agent Morrison moved the bird to a secure site. Muck designed a five-foot-high cage with multiple perches and a variety of foods. She exercised the parrot twice a day, spreading its wings and strengthening its muscles, getting it used to different foods by placing them next to different perches.

She took care not to make the bird dependent on her, since the goal was to return him to the society of other parrots. Muck brought another parrot to give the Spix's macaw company.

Because birds held in captivity are often deprived of hearing the cries of their own species, Muck taped the parrot's cries and played the tape back to him. The sounds excited Presley, who gradually emerged from his listlessness. Officials at the Denver zoo helped determine when the parrot was ready for a 20-hour flight to Brazil.

On Sunday, with Presley weighing nearly 14 ounces -- three more than when she started -- Muck and Morrison took him to the Denver airport. Security officials stared as Muck , who paid for her ticket herself, placed the parrot inside her shirt and walked through the security gates. On board, Presley's cries drew attention.

Children nearby asked, "What's that noise?" and Muck heard their parents reply, "It's a parrot. Like Grandma's parrot."

She thought to herself, "I hope Grandma doesn't have a parrot like this."

At the Miami airport, Muck and Morrison handed the parrot to Iolita Bampi, a senior Brazilian wildlife protection official. Muck bid the parrot farewell, and, after at least a quarter century of captivity in another country, Presley returned home.

Yesterday, biologist Fernanda Vaz at the Sao Paolo zoo said Presley was doing fine, that he was eating well and was very healthy. Officials plan to move him to Recife, where the breeding program is underway.

"In 15 years, there's every likelihood we will be talking about Presley having reproduced or his genome having been cloned," Gilardi said. "In some way, he will contribute to the continuation of his species."

Staff writer Guy Gugliotta contributed to this article.

Mischelle Muck with Presley, a blue Spix's macaw who was discovered in Colorado.Presley could contribute genetic diversity to the Spix's macaws in Brazil.