The top-ranked American, Jordan Spieth, ranked No. 2 in the world, once wholeheartedly embraced the Olympic experience. He has been more tempered in his enthusiasm recently. But he is expected to compete because he is a brand ambassador for Coca-Cola, which is the longest continuous sponsor of the Olympics, having been aligned with the competition since 1928.

Still, several of the world’s best athletes will be absent. On Tuesday, the president of the International Olympic Committee, Thomas Bach, endorsed the decision by track and field’s world governing body to bar Russia’s team from the Olympics. (Russia won 18 medals at the last Summer Games, in 2012 in London.) Bach also called for heightened scrutiny of athletes from Kenya, where antidoping efforts have been found lacking.

McIlroy’s patriotism lured him across the Atlantic from his Florida home base to watch his countrymen from Northern Ireland play Germany on Tuesday in a European Championships soccer match. And more than most golfers who did not grow up dreaming of Olympic glory, he seemed to grasp the grandeur of the Summer Games, which have not featured golf since 1904. McIlroy mingled with the world’s athletes in 2012 when he watched his then-girlfriend Caroline Wozniacki compete in tennis at the London Games.

But circumstances change, and McIlroy, who is engaged to Erica Stoll, decided the risks of competing in Rio outweighed the potential rewards.

“After speaking with those closest to me, I’ve come to realize that my health, and my family’s health, comes before anything else,” McIlroy said in a statement. “Even though the risk of infection from the Zika virus is considered low, it is a risk nonetheless, and a risk I am unwilling to take.”

None of the world’s top female golfers have backed out of the Olympics, even though they ostensibly face a greater health risk. The women, who do not have as high a profile as the men, are perhaps more determined to compete in the Olympics because winning a medal carries greater value for them in terms of increasing their exposure.

The Olympics were fraught with complications for McIlroy from the start. As a Northern Irishman, he had the choice to compete for Britain or Ireland. In 2012, he earned the animus of people in Ireland, including those in the Golfing Union of Ireland who had shepherded his development, by suggesting that he was leaning toward representing Britain because he had always felt more British than Irish.