The quake's epicentre was just nine kilometres (5.6 miles) beneath the surface, Xinhua said.
Southwest China is prone to earthquakes, with twin quakes in Yunnan last September triggering landslides which killed at least 80 people.
The local earthquake bureau has dispatched a team to the area, Xinhua said.