Every competitor from Russia and Kenya expecting to take part in the Rio de Janeiro Olympics will have to be evaluated individually for doping and be cleared by their sports's international body, says Olympic chief Thomas Bach.
The special measure was being introduced, Bach said, because of the unsatisfactory record of the anti-doping bodies in the two countries, which Bach said had put "very serious doubts on the presumption of innocence" of the athletes.
Russian track and field athletes remain suspended from Rio after the International Olympic Committee (IOC) approved a blanket ban on them - extended on Friday by world athletics' governing body - for systemic doping.
Kenyan athletes are not banned. But their country's anti-doping structures are judged not to have been compliant with international standards.
But IOC President Bach, speaking at the end of a doping summit, gave a limited number of Russian athletes a chance to race for their country in Brazil despite a ban.
He said any Russian athlete cleared by the world athletics body IAAF or the Court of Arbitration for Sport as clean and eligible could compete under the Russian flag.
Russian Olympic Committee (ROC) chief Aleksander Zhukov, meanwhile, said clean Russian athletes would appeal the "legally indefensible" ban at the Court of Arbitration for Sport.
Any athletes who succeeds in their appeal would compete under the Russian flag, Bach said, not an Olympic or neutral one as the IAAF had suggested last week.
"The position is very clear: we respect this (IAAF) decision. We advised today that athletes and/or the ROC may appeal," Bach said. "This is the good right of everybody. We expect the results of these potential court cases."
"If there are (Russian) athletes qualified then they will compete as members of the Russian Olympic Committee team," Bach told reporters at the end of an extraordinary summit.
The decision is expected to somewhat appease the Russians, who were unhappy with the ban of their track and field athletes by the IAAF from the world's biggest multi-sport event.
In a carefully-worded three-page declaration following the summit, the IOC ordered all international federations to "take swift action" and ban athletes who had tested positive in re-testing of samples from the 2008 and 2012 Olympics.
A total of 55 athletes had tested positive for performance-enhancing drugs in those re-tests in recent weeks with the IOC having said none of those athletes would compete in Rio.
Bach also said the summit, including sports federations and Olympic committees, had decided to fully review the anti-doping system, calling on the World Anti-Doping Agency to hold a global conference next year.
The IOC President said the meeting had not discussed the potential participation of whistleblower Yulia Stepanova, a former drugs cheat whos revelations sparked the scandal, after the IAAF gave her hope of competing at the Games.