In ceremonies throughout China, including a gigantic memorial service here, Chinese swept away more than a decade of official history today by honoring the memory of the former political villian and president Liu Shao-Chi.

In a memorial speech broadcast live on television throughout the country, Liu's colleague Deng Xiaoping said Liu "had some shortcomings and mistakes in his work," but in the end was "a great Marxist and proletarian revolutionary, who dedicated the whole of his militant life to the cause of communism."

Deng and Lui both were purged in the late 1960s, but Deng lived long enough to return to power. He continued the current effort to preserve the good name of the late chairman Mao Tse-tung, even though Mao was responsible for the campaign that ended Liu's career and his life.

Deng said Liu "was the first to advance the concept of Mao Tse-tung thought; he publicized it energetically at the Seventh National Congress" in 1945.

Deng's 22-minute speech highlighting moments in Liu's career avoided mention of th most difficult twists in the calamitous Mao-Liu relationship. In 1959, Lui assumed Mao's title as president, apparently without the chairman's complete approval. He sought to strengthen the government by emphasizing training of a skilled party elite, which did not suit Mao's view of China run by the broad masses.

In mid-1966, Mao persauded the leading Army general, Lin Biao, to help him throw Liu and tens of thousands of other veteran party officials out of office. Liu was labeled "the top party person taking the capitalist road" and "China's Khrushchev."

Liu died of an untreated illness, possible pneumonia, Nov. 12, 1969, shortly after being transferred to prison in Kaifeng, Henan Province.

The memorail meeting at which Deng spoke was held in the auditorium of the Great Hall of the People. Attending were 10,000 specially invited mourners. They performed the sort of belated funeral service that has been done for thousands of rehabilitated victims of the 1960s purges in the three years since Mao's death.

As perhaps a symbol of the moderate methods of Deng and other Liu heirs, standing with other Central Committee members in the audience were at least three former Politburo members recently purged for their close ties to Chairman Mao: Wang Dongxing, Ji Dengkui and Wu De.

Chairman Hua Guofeng, whom Mao anointed as his heir before his 1976 death, persided over the ceremony, which included three bows by the audience to a huge, 15-foot-high black-and-white photograph of Liu. A box with Liu's ashes, covered by a national flag, sat under the photograph.

The official News China News Agency said the ashes would be scattered in China's coastal waters" as Liu wished. One of the other great popular heroes of the Chinese revolution, Chou En-lai, also had his ashes scattered, while Mao's body, perhaps against what might have been his own wish, is refrigerated, embalmed, and displayed periodically in a huge memorial hall.

After the ceremony here, Liu's widow, Wang Guangmei, shook hands with the party leaders as they filed past. The ceremony was a final vindication for Wang, who was also imprisoned and subjected to abuse during the 1960s.

Tonight, apparently for the first time in 14 years, Peking television showed film clips of Liu's 1966 trip to Southeast Asia, including shots of Wang in a slit Chinese dress. In 1967, Red Guards used the dress as a symbol of her bourgois leanings and forced her to put it on in a celebrated criticism meeting.