The China News Service said three people died, citing the local county government.
Residents of Kunming, the capital of neighboring Yunnan province, felt a strong shock from the earthquake, with many running into the streets despite falling rain, it said. Telecommunications were temporarily cut but then restored, it said.
A duty officer at the State Seismology Bureau said the quake occurred in a mountainous area. He did not want to give his name, as is common with officials in China.
The bureau is still gathering information, he 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.