TOKYO ­— Olympic organizers will allow spectators at this summer's Tokyo Games but cap attendance at 10,000 people or 50 percent of a venue's capacity, whichever is smaller, they announced Monday.

The upper limit will not include VIPs, officials and other "stakeholders," organizers said, nor will it include school groups, which were given preferential opportunities to attend events.

But organizers also warned they could ban spectators entirely if the country's situation with coronavirus infections deteriorates dramatically before the Games open July 23.

“We acknowledge that there’s uncertainty on the situation with the pandemic during the Games, so we need to be very flexible,” said Seiko Hashimoto, president of the Tokyo 2020 Olympic organizing committee.

Any “abrupt change in the situation,” including the declaration of a new state of emergency over the period when the Games are taking place, would prompt a reconsideration, she said. In such a scenario, “all the options, including no spectator games, will be examined by the stakeholders.”

Earlier, Japanese Prime Minister Yoshihide Suga said he would prefer to see fans in the stands, but if the pandemic situation worsens, banning any from attending is “definitely a possibility.”

In March, organizers banned spectators coming from abroad. The decision to allow a limited number of domestic fans is controversial, given that the government’s scientific advisers warned last week that allowing anyone into venues would increase the coronavirus risk in Japan, where vaccination rates remain low among people under 65.

But the restrictions will leave many fans disappointed after tickets were initially allocated in fiercely competitive domestic lotteries.

Organizers say they have sold tickets for an average of 42 percent of venue capacity, but exact proportions vary widely across events. Hashimoto said existing ticket sales only exceed the cap for around 10 percent of events.

For these events, likely to include the Opening and Closing Ceremonies and popular track and field events in National Stadium, a fresh lottery will be held to allocate tickets, she said. In cases where ticket sales are below the cap, no new tickets will be placed on sale.

Reports in the Japanese media suggest attendance at the Opening and Closing Ceremonies in 68,000-capacity National Stadium could swell to 20,000, given a large allocation of tickets for VIPs and officials. Toshiro Muto, CEO of Tokyo 2020, said he was aware of the reports, but he didn’t think the final number would be that large.

The government’s painfully slow start to its coronavirus vaccination program left organizers with little choice but to limit or ban spectators. A group of medical experts said last week the “least risky” and most desirable option would be to ban spectators entirely.

“There is a risk the movement of people and opportunities to interact during the Olympics will spread infections and strain the medical system,” the experts, led by the government’s most senior health adviser, Shigeru Omi, said in a report issued Friday.

If spectators were to be let in, the expert panel recommended a cap below 10,000 and that they should not be allowed to travel from other prefectures.

In the end, though, organizers decided to overrule that advice. Japan and the International Olympic Committee are keen to showcase the Games as a symbol of humankind’s “victory” over the pandemic, an argument that would have been harder to make in empty venues.

Hashimoto said the Olympics were a “symbol of peace” and reinforced the need for humankind to work together to overcome challenges.

Organizers have published a voluminous set of “playbooks” designed to limit infections, with strict rules on how athletes, officials, journalists and spectators are expected to behave, and threatening punishment for rulebreakers. Spectators, for example, are being asked to go straight from their homes to venues and straight home afterward, and to refrain from cheering or shouting inside venues.

Hashimoto also defended the decision to exempt school groups from the spectator cap, arguing it was important for the “younger generation to experience the excitement and emotion of the Games.”

“People still talk about what they saw in the first Tokyo Olympics [in 1964],” she said. “It’s a memorable event and we wanted to offer the same experience to younger children.”

The risk, though, is the Games leave behind a deadly legacy of rising coronavirus infections in Japan, or that the pandemic undermines the integrity of the competition.

Those risks were sharply underlined Saturday, when a vaccinated member of Uganda’s team tested positive for the coronavirus upon arrival in Japan.

Uganda’s team had been vaccinated with Oxford-AstraZeneca shots and tested negative for the virus before departure, Japanese media reported, quoting an unnamed government official.

The IOC has said more than 80 percent of the 11,090 athletes arriving for the Games have been or will be vaccinated by the time they arrive in the Olympic Village, while between 70 and 80 percent of the journalists and media representatives arriving from abroad will be vaccinated.

But the news from the Ugandan camp will raise concerns this won’t be enough to eliminate the risks.

“Let’s all wait a minute,” opposition lawmaker Renho Saito said on Twitter over the weekend. “This time, nine people arrived. For the Olympics, 100,000 people will be arriving. This is no time to be talking about how this will be a moving experience for our children.”

Japan’s coronavirus vaccination drive has finally kicked into gear in recent weeks. So far, around 29 million doses have been delivered, with nearly 17 percent of the population having received at least one dose. The government hopes to have fully vaccinated almost all people over 65 by the end of July.

On Thursday, Suga partially lifted a state of emergency in Tokyo and several other prefectures after a slowdown in the rate of new infections, but authorities have left some restrictions in place on restaurants and bars in what they call a “quasi state of emergency.”

Japan has allowed limited numbers of spectators to attend sporting events for most of the pandemic, albeit with bans on singing, shouting and even flag-waving, and intermittent restrictions on the sale of alcohol, with studies showing no evidence of significantly increased transmission of the virus.

Caps on spectators have shifted with the state of the pandemic, with 24,219 fans attending soccer’s Levain Cup final in National Stadium in January.

Before the pandemic, demand for tickets for the Games had been extremely high, with domestic lotteries vastly oversubscribed. Organizers had sold around 4.45 million tickets domestically and 600,000 to overseas fans before the Games were postponed, but those numbers have since fallen back.

Organizers received around 810,000 requests for domestic refunds at the end of last year.