WASHINGTON — It's official: The National Institutes of Health plans to end most use of chimpanzees in government medical research, saying humans' closest relatives "deserve special respect."

The NIH announced Wednesday that it will retire about 310 government-owned chimpanzees from research over the next few years, and keep only 50 others essentially on retainer — available if needed for crucial medical studies that could be performed no other way.

"These amazing animals have taught us a great deal already," said NIH Director Dr. Francis Collins. He said the decision helps usher in "a compassionate era."

The NIH's decision was long expected, after the prestigious Institute of Medicine declared in 2011 that nearly all use of chimps for invasive medical research no longer can be justified. Much of the rest of the world already had ended such research with this species that is so like us.

Any future biomedical research funded by the NIH with chimps, government-owned or not, would be allowed only under strict conditions after review by a special advisory board. In five years, the NIH will reassess if even that group of 50 government-owned apes still is needed for science.

What's unclear is exactly where the retiring chimps, which have spent their lives in research facilities around the country, now will spend their final years. NIH said they could eventually join more than 150 other chimps already in the national sanctuary system operated by Chimp Haven in Louisiana. In that habitat, the chimps can socialize at will, climb trees and explore different play areas.

But NIH officials said currently there's not enough space to handle all of the 310 destined for retirement. They're exploring additional locations, and noted that some research facilities that currently house government-owned chimps have habitats similar to the sanctuary system.

The other hurdle is money: Congress limited how much the NIH can spend on caring for chimps in the sanctuary system. Negotiations are under way to shift money the agency has spent housing the animals in research facilities toward supporting their retirement.

"Everybody should understand this is not something that is going to happen quickly," Collins cautioned.

The NIH's decision came two weeks after the Fish and Wildlife Service called for protection of all chimpanzees as endangered. Until now there was a "split listing" that labeled wild chimps as endangered but those in captivity as threatened, a status that offers less protection.

That move also would affect any future use of chimps in medical research, and NIH said it would work with its government counterpart to ensure compliance.

Chimps rarely have been used for drug testing or other invasive research in recent years; studies of chimp behavior or genetics are a bit more common. Of nine biomedical projects under way, the NIH said six would be ended early. Of another 13 behavioral or genetic studies involving chimps, five would be ended early. NIH would not identify the projects, but Collins said potential future need for chimps could be in creating a vaccine against hepatitis C.