Rescue teams were headed to the quake-hit area but heavy rains and the region's rugged terrain hampered their efforts, the official Xinhua News Agency said.
The quake killed 17 people in Sichuan and five others in the neighboring province of Yunnan, Xinhua said.
The agency said about 100 people in Sichuan and 35 in Yunnan were injured. The quake hit 31 miles southeast of Panzhihua city in the southwestern corner of Sichuan on Saturday afternoon.
Nearly 1,000 houses were destroyed in Panzhihua, and it was not known how many people were buried in the rubble, the report said.
The China Earthquake Administration sent teams and seismic experts while the Yunnan provincial civil affairs bureau and the Yunnan Red Cross Society sent 3,400 tents and 2,000 quilts, Xinhua said.
Also Saturday, an earthquake measuring 5.3 on the Richter scale struck the northwestern region of Xinjiang, Xinhua said in a separate report.
No casualties were reported from the quake which hit the sparsely inhabited Tianshan mountains, it said.
On May 12, a 7.9 magnitude earthquake in northern Sichuan killed nearly 70,000 people and left 5 million homeless. The region has been hit by scores of aftershocks, keeping people there on edge.