In an enormous case of mistaken identity, millions of Chinese this morning thought that Beijing had won the competition to hold the 2000 Olympic Games, setting off a citywide celebration of fireworks and cheers that collapsed in disappointment minutes later.

On the campus of Beijing University, about 400 students had gathered in Dining Hall No. 3 to watch the televised announcement, which came just before 2:30 A.M. A celebration erupted as Juan Antonio Samaranch, president of the International Olympic Committee, in thanking the five contestants uttered "Beijing" before any other city's name.

The same unbridled joy occurred at Beijing's central television station auditorium, where the official televised celebration was to be held. As Samaranch began to speak from Monte Carlo, Monaco, the Beijing auditorium suddenly exploded with cheers. Confetti flooded from the rafters, only to be followed by a wave of despair a few minutes later when images from Sydney, Australia, the victorious entry, flashed across giant television screens.

Faces fell and jaws dropped as fast as the bunting. Many in Beijing had convinced themselves over the final days that their front-running bid would win, and they were devastated. When the confusion cleared in China, the Government's propaganda machinery clicked into action when an official broadcaster appeared on national television channels and read a prerecorded editorial in which China faced its loss.

"We respect the Olympic Committee's decision and congratulate Sydney on its success," the statement said and went on to promise that the competition had deepened the country's commitment to economic reform and to the Olympic movement. China vowed to put its efforts into competing at Sydney and playing host to the 2004 Games.

The decision represented a significant blow to the Communist Party leadership, which mounted the most vigorous campaign of any nation to win the competition. China's bid had become an urgent political priority this year at a time when the country's economy has surged to world prominence and Communist Party leaders are seeking to validate China's return to the international stage after more than four years of isolation stemming from the June 1989 Tiananmen Square crackdown that crushed a student-led democracy movement.

Bitter disappointment and a sense of rejection was palpable in the city and in the faces of Olympic supporters who had gathered at hotels and meeting halls.

"When I saw the Australians waving their arms, I felt so shameful," said a member of China's national sports committee attending an announcement party at a northeast Beijing hotel. "I'm Chinese. That's not what I was waiting for."

"There were no winners in the bidding," said Yang Tianle, a medical official on the national sports team. "There is only the lucky one."

In a message to the Chinese delegation in Monte Carlo, Li Tieying, a Chinese Politburo member, said, "There were many reasons why China did not win the right to hold the 2000 Olympics, but this doesn't mean that China does not have the strength and the conditions to hold an Olympics."

He continued: "Applying for the Olympics is an important step in our country's process of reform and opening up. Although we did not win the right to hold the 2000 Olympics, through our steady work, we achieved very big results."

Although its official statement sought to take the high road, a strain of deep resentment, especially toward the United States and other Western nations that had cited China's poor human rights record as a disqualifying factor, was present here today.

During the afternoon, rumors circulated at Beijing University that students were planning to march on the United States Embassy if Beijing's bid failed.

But that seemed a remote possibility. In recent days, Chinese security officials have warned residents of Beijing to take the news from Monte Carlo calmly and to stay off the streets no matter what the decision.

During the day and into the evening, university authorities exercised tight control over the heavily policed campus and, minutes after the television announcement was concluded, students were asked to return to their dorms and go to sleep. Beijing's Problems