RIO DE JANEIRO — Olympic officials announced on Thursday night that 271 Russian athletes had been approved to compete in the Rio Games — 118 fewer than the country had hoped to enter.



But with less than 24 hours until the opening ceremony, the matter remained in question. Soon before the International Olympic Committee’s announcement, an appeals court issued a ruling in favor of two Russian athletes that seemed to undercut the officials’ case against their delegation.

The Olympic committee’s exclusion of nearly a third of Russia’s athletes for their ties to a government-sanctioned doping program was a blow to the integrity of the Games and will severely diminish Russia’s presence across several sports in Rio. Still, Thursday’s decision was far better for Russia than what many antidoping officials had called for: a ban on its entire team.

The International Olympic Committee said that it had consulted with top officials for the 28 sports participating in the Summer Games. Those officials had been asked to scrutinize the drug-testing history of each Russian athlete.