The Russian flag will be flying at the Summer Olympics, after all, as the International Olympic Committee decided Sunday that athletes from the nation mired in an ongoing drug scandal will be allowed to compete on the sporting world’s largest stage next month in Rio de Janeiro.

Less than two weeks before the start of the Rio Games, the International Olympic Committee ruled against barring Russia from the Summer Olympics but did approve measures that could reduce the number of Russian athletes participating. Members of the executive board met on a conference call Sunday and granted authority to the 28 individual federations that govern each sport to rule on which Russian athletes should be permitted to compete in their respective disciplines.

While that could curtail Russia’s participation in the Rio Olympics, it means the exact number of Russian athletes and medal hopefuls representing the nation could remain in flux until days before the opening ceremony, which is scheduled for Aug. 5.

“This is not about expectations. This is about doing justice to our clean athletes all over the world,” IOC President Thomas Bach said on a conference call Sunday afternoon. “In this way, we protect these clean athletes because of the high criteria we set for all the Russian athletes. This may not please everybody on either side. ….but still the result today is one which is respecting the rules of justice and which is respecting the right of all the clean athletes all over the world.”

Others had a different interpretation of the IOC’s decision, contending that allowing Russia to participate in any part of the Rio Olympics threatens the integrity of the competition and invites imbalance and doubt to the Olympic playing field.

“The decision regarding Russian participation and the confusing mess left in its wake is a significant blow to the rights of clean athletes,” Travis Tygart, the CEO of the U.S. Anti-Doping Agency, said in a statement.

Tygart has been among those most vocal in recent weeks for an outright ban of Russia at these Olympics, saying the nation’s athletes and sporting officials have sown seeds of distrust and shown a brazen willingness to break rules.

“The IOC has stated before that they believe anti-doping should be wholly independent, and that is in part why it is so frustrating that in this incredibly important moment, they would pass the baton to sports federations who may lack the adequate expertise or collective will to appropriately address the situation within the short window prior to the Games,” Tygart said. “The conflict of interest is glaring.”

In noting that the decision was a complicated – but unanimous — one for the executive board, Bach said the IOC struggled with the prospects of banning the entire country and punishing any athlete who might not have been specifically implicated in the controversy or ever accused of wrong-doing.

“At the end of the day, you have to be able to look into the eyes of the individual athlete concerned by your decision,” he said. “In this respect, I really am convinced of this decision and I’m fine with this decision.”

With Olympic competition scheduled to start in 12 days, the international federations are left with a very short window in which they must review the IOC’s stated criteria and determine which Russian athletes should be allowed to compete.

“This is a very ambitious timeline,” Bach said, “but we had no choice.”

Joseph de Pencier, CEO of the 59-Member Institute of National Anti-Doping Organizations, said the IOC’s decision marks a “sad day for clean sport” and amounts to the Olympics’ powerful governing body opting to pass the buck to the international federations. He said with so little time, the international federations will have a difficult time applying the required criteria to properly approve clean Russian competitors.

“The IOC Executive Committee has failed to confront forcefully the findings of evidence of state-sponsored doping in Russia corrupting the Russian sport system,” de Pencier said in a statement. “It has ignored the calls of clean athletes, a multitude of athlete organizations, and of leading National Anti-Doping Organizations, to do the right thing by excluding Russia from the Rio Olympic Games.”

While the International Association of Athletics Federations (IAAF), the international body that oversees track and field, has already ruled that Russia would not be permitted to compete in Olympic competition, some sports federations, such as gymnastics, have already indicated a preference to see Russian athletes competing for Olympic medals. Bruno Grandi, president of the FIG, the international gymnastics federation, for example, said in a statement last week, “Blanket bans have never been and will never be just.”

In a post on the organization’s website, the IAAF offered to assist other sports federations as they decide which athletes should be eligible to compete in Rio.

Governing bodies for the various Olympic sports immediately began studying the criteria and the list of likely Russian participants. The International Tennis Federation was among the first Sunday to clear Russian players to compete in the Rio Games, saying the athletes have already been “subject to a rigorous anti-doping testing program outside Russia.”

“The ITF believes it is right that clean athletes are permitted to compete in Rio 2016 and looks forward to welcoming the Russian tennis players, along with all other nominated athletes, to Rio,” the organization said in a statement.

No nation had ever been barred from competing at an Olympics for doping, but with sentiment growing against the Russian athletes and questions about whether they’d compete clean in Rio, the IOC faced a difficult decision. Last week the World Anti-Doping Agency, the international body that polices doping in sports, released a damning report that charged Russia with operating a prolific state-run doping program spanning 30 sports over several years.

As the doping scandal grew, more than a dozen anti-doping agencies from around the world, including those from the United States and Canada, banded together and urged the IOC to issue a wholesale ban of Russia from these Olympics, an extraordinary measure that would have included athletes who’ve never tested positive for banned substances or been implicated in the scandal.

The IOC opted not to take immediate action last week, preferring to wait for an important ruling from the Court of Arbitration for Sport (CAS), which last Thursday upheld the ban on Russia’s track and field teams. In June, those squads were barred from the Rio Games by the IAAF.

The World Anti-Doping Agency, which polices drug cheating in sports, accused the Russian government of complicity in a widespread doping regime, calling into question whether any Russian athletes should be permitted to compete at Summer Olympics next month. (Reuters)

The Russian Olympic Committee said in a statement last week that the court’s ruling unfairly punished a large swath of Russian athletes for the alleged misdeeds of a few. “The CAS decision violates the rights of all clean athletes who from today will also bear a collective responsibility for the guilt of others,” the committee said.

While officials with the Russian sports ministry have acknowledged a “culture of doping,” they have denied any form of government involvement. Russia President Vladimir Putin has been vocal about what he sees as an unfair process with political undertones, saying last week that the “Olympic movement, which is a tremendous force for uniting humanity, once again could find itself on the brink of division.”

Russia’s influence and Putin’s relationship with Bach raised eyebrows among both anti-doping officials and some athletes.

“I ask myself if we were not dealing with Russia would this decision to ban a nation been an easier one? I fear the answer is yes,” Hayley Wickenheiser, Canada’s five-time Olympic hockey player and a  member of the IOC athletes’ commission, posted on Twitter on Sunday.

The IOC on Sunday approved a list of criteria that athletes must meet, which largely calls on athletes to prove they compete without the aid of performance-enhancing drugs and for the international federations to determine the validity of their claims and make a final judgment. The executive board agreed that no Russian athlete who’s previously been sanctioned for a doping violation would be allowed to compete in Rio, which means that whistle-blower Yulia Stepanova, a Russian middle-distance runner who helped expose the extent of doping there, will not be allowed to participate in these Summer Games.

In a statement, the IOC said it “would like to express its appreciation for Mrs. Stepanova’s contribution to the fight against doping and to the integrity of sport,” and extended an invitation for Stepanova to attend the Rio Games as a spectator.

Tygart, the USADA CEO, said that “the decision to refuse her entry into the Games is incomprehensible and will undoubtedly deter whistleblowers in the future from coming forward.”

Before a single Olympic event has been contested, doping has already emerged as a dominant story line of these Summer Games. The IOC and WADA have been trying to cleanse the Rio Games of known cheaters and have been retesting samples from the 2008 and 2012 Summer Olympics. They found 98 athletes who tested positive for prohibited substances, including at least 23 medalist from the Beijing Games.

Since competing under the Russian flag, the country has been among the top three or four medal winners in each of the past five Summer Olympics. Russia, which has traditionally been a power in track and field, wrestling and gymnastics especially, won 79 medals at the 2012 London Games, trailing only the United States (103) and China (88). Russia hosted the 2014 Winter Games in Sochi and won more medals there than any other country – 13 golds and 33 overall — a feat that might not stand the test of time after the IOC and WADA completes their doping inquiry and metes out individual punishments.

The absence of any number of Russian athletes will surely have a major impact on the medal hopes of athletes competing in almost every sport. Russian typically sends an Olympic team of more than 400 athletes at the Summer Games. The last time Russian athletes missed the Summer Games was 1984, when the then-Soviet Union was among 14 communist nations to boycott the Olympics. That year the United States won 83 gold medals at the Los Angeles Summer Games, which is still an Olympic record.

More Rio Olympics coverage