TOKYO (AP) -- A sharply limited number of fans will be allowed to attend the Tokyo Olympics, organizers announced Monday as they tried to save some of the spirit of the Games where even cheering has been banned.

Organizers set a limit of 50% capacity - up to a maximum of 10,000 fans, all of whom must be Japanese residents - for each Olympic venue, regardless of whether it is indoors or outdoors. Officials said that if coronavirus cases rise again the rules could be changed and fans could still be barred all together. Spectators from abroad were banned several months ago, and now some local fans who have tickets will be forced to give them up.

The decision comes as opposition among Japanese to holding the Games in July remains high, though may be softening, and as new infections in Tokyo have begun to subside.

Still, health officials fear that in a country where the vast majority of people have yet to be vaccinated, crowds at the Olympics could drive cases up. The country's top medical adviser, Dr. Shigeru Omi, recommended last week that the safest way to hold the Olympics would be without fans. Allowing fans presents a risk not just at the venues but will also lead to more circulation on commuter trains, in restaurants and other public spaces.

It's already become clear that these Olympics Games will be unlike any others, but organizers have said they are determined to hold them and billions of dollars in broadcast rights and ticket sales are at stake. Still, much of the fanfare that surrounds them - people from around the world rubbing elbows, a celebratory atmosphere in the host city and the showcasing of the host country's culture - will be off the table or far more muted this year.

Seiko Hashimoto, the president of the Tokyo Olympic organizing committee, called the decision “the last piece for the Olympics” to proceed on July 23.

But as with everything about these Olympics - the first postponed in the history of the Modern Games dating from 1896, though previous ones were canceled during both World Wars - the decision raised many questions.

For one, it is not quite what it seems. Although a maximum of 10,000 fans will be allowed in any given venue, so-called stakeholders - including sponsors and sporting federation officials - will not be counted toward that total, according to organizing committee CEO Toshiro Muto. Japanese media, for instance, reported that up to 20,000 people might attend the opening ceremony, over and above athletes, though Muto said he thought it would be less than that.

The decision on local fans was announced after so-called Five Party talks online with local organizers, the International Olympic Committee, the International Paralympic Committee, the Japanese government and the government of metropolitan Tokyo. A decision on the Paralympics comes on July 16.

Hashimoto, meanwhile, left the door open for a no-fans Olympics if the conditions worsen around the pandemic.

“We need to be very flexible. If there is any abrupt change in the situation, we will hold five-party meetings again to make other decisions,” Hashimoto said. “If there is an announcement of a state of emergency during the Games, all the options like no-spectator games will be examined.”

Officials say local fans will be under strict rules. They will not be allowed to cheer, must wear masks, and are being told to go straight home afterward.

“We would like people to go directly home from the venue without stopping by anywhere,” Muto said.

He said 3.64 million tickets were already in the hands of Japanese residents. He indicated that was about 900,000 more than the seats likely to be available. That will mean a lottery to see who can attend.

Tokyo organizers had expected about $800 million in revenue from ticket sales, but Muto said the actual figure would be no more than half that. Any shortfall will have to be picked by some Japanese government entity.

The University of Oxford has said these are the most expensive Olympics on record. The official cost is $15.4 billion, but several government audits suggest it might be twice that much. All but $6.7 billion is public money.

The IOC relies on selling broadcast rights for almost 75% of its income. Another 18% is from sponsors. A cancelation would cost the IOC an estimated $3 billion-$4 billion in lost broadcast income - an enormous blow especially at a time when its income flow has already been slowed by the pandemic.

The decision comes just as Tokyo has emerged from a state of emergency as the curve of new cases has flattened. The seven-day average for new infections in the city is about 400 daily.

The capital and other areas are now under “quasi-emergency” status until July 11. The new rules will allow restaurants to serve alcohol during limited hours, the main outcome from the reduced restrictions.

Overall, more than 14,000 deaths have been attributed to COVID-19 in Japan, which has managed the pandemic better than many countries but not as well as some others in Asia. Its vaccination campaign remains behind many Western ones, with about 6.5% of Japanese fully vaccinated and 16.5% with at least one shot.

Prime Minister Yoshihide Suga, who has favored allowing fans, said before the official announcement that he would bar fans if conditions change. Tokyo Governor Yuriko Koike echoed that.

“If a state of emergency is necessary, I will be flexible and open to no fans in order to achieve that the Games give top priority to safety and security for the people,” Suga said.

He said he took “seriously” Omi's recommendations but did not follow them.

In recent polls, support seems to be increasing for holding the Olympics, though a majority still appear to favor postponing or canceling the Games, depending how the question is worded.