Peking's millions went on a joyful rampage tonight in one of the most deafening and chaotic street parties ever seen.

Traffic police, short-tempered in the sweltering heat, finally gave up trying to keep order among the throngs paying a tribute to the greatest survivor in Chinese politics, Teng Hsiao-ping.

The announcement that the 74-year-old former vice premier had been rehabilitated was still being read over Peking Radio when the first revelers started setting off firecrackers.

The radio also announced that Teng's radical opponents, the "Gang of Four," have been expelled from the Communist Party, a sentence of political death.

Within half an hour the great Avenue of Eternal Tranquility was crammed with chanting, flag-waving Chinese.

It was supposed to be highly organized like all demonstrations in this city of six million people, but the mood was too euphoric. The neat columns soon broke apart and emerged. It grew into the sort of merry mob that welcomes home a victorious sports team.

Loudspeakers carried stirring, martial music. Buildings along the Avenue of Eternal Tranquility turned on colorful lights.

The radio announcement, which was issued simultaneously by the New China News Agency, said the decisions were taken by the Third Plenum of the 10th Central Committee, which met here from July 16 until yesterday.

The plenum adopted three resolutions, confirming Hua Kuo-feng as chairman of the Communist Party and successor to Mao Tse-tung, restoring Teng to power and expelling the "Gang of Four."

The agency said the radicals, led by Chairman Mao's widow Chiang Ching, have been expelled from the party "once and for all" and dismissed from all posts.

"The communique said the plenum had also decided to convene a new Communist Party Congress later this year, but gave no specific date. It said the congress would appoint a new Central Committee and revise the party constitution.

Even before the long-awaited announcement, celebrations were under way in central Peking. Wall posters appeared hailing the plenum's decision and small groups paraded through the streets chanting, "Down with the Gang of Four."

The announcement said Teng, the main victim of last year's power struggle, had won back his four top posts . . . party vice chairman, vice premier, vice chairman of the Military Commission and chief of the general staff.

It means that Teng becomes the clear favorite to become premier should Chairman Hua give up the post.

Teng's radical opponents have been under house arrest since October and are accused of plotting a coup and distorting Mao's instructions. The communique gave no clue of what fate awaited them.

Teng's political exile lasted 15 months. It is the second time he has returned from humiliating disgrace.

Teng was first purged as a revisionist during the Cultural Revolution in the late 1960s. He was restored to power in 1973 by his mentor, the late Premier Chou En-lai, only to be denounced as a "capitalist roader" and forced from power again last year by the radicals in the upheavals that followed the deaths of Chou and Mao.