The earthquake hit Lushan county of Ya'an city at 8.02 am, Xinhua cited the China Earthquake Networks Center (CENC) as saying.
More than 1,000 people were injured in the earthquake, the Lushan county publicity department said. Among those injured, 135 are in serious condition.
Firefighters pulled out 27 survivors from collapsed structures in Lushan, the ministry of public security said.
Water and electricity supply in the county was cut off due to the quake. Most of the buildings in the old urban area of Lushan county and Longmen township collapsed.
Landslides blocked traffic in many places across the county and two barrier lakes caused by the landslides were posing risks in the rescue effort, officials said. Many vehicles were damaged by rolling rocks.
Patients were given treatment at the Lushan County Hospital.
The strongest aftershock after the quake was measured at 5.3-magnitude. It jolted the border areas between the counties of Lushan and Tianquan at 11.34 am, the provincial seismological bureau said.
About 400 policemen arrived in Lushan to assist in the rescue efforts. More than 1,400 rescuers from the provincial fire-fighting department have also been deployed.
The hardest-hit areas are the townships of Longmen and Qingren, said an official with the provincial armed police corps.
The China Earthquake Administration (CEA) said the quake originated in the Longmenshan fracture zone. A total of 12 earthquakes at 5.0-magnitude or above have occurred in the area within 100 km of its epicentre since 1900, including a devastating 8.0-magnitude quake in Wenchuan in 2008 that left 87,000 people dead or missing.
A team of over 600 firefighters with 110 fire-fighting vehicles and six sniffer dogs, as well as a medical team have been sent to the quake-hit region. More than 6,000 military and armed police personnel and several aircraft have also been dispatched to help in rescue efforts.
The ministry of civil affairs has dispatched relief materials, including 30,000 tents, 50,000 blankets and 10,000 make-shift beds.
Meanwhile, the Bifeng Gorge base, a panda research base affiliated to the Wolong Giant Panda Protection and Research Center which is only 47 km from the epicentre, reported no human or panda casualties.
About 200 technicians from China Mobile Limited have been dispatched to the disaster-hit areas to repair the telecom network.
Mumbai Roundup: 9 incidents that took place this week
Photos: Ajay Devgn, Parineeti, Tabu at 'Golmaal Again' trailer launch
Photos: Dipika Pallikal Karthik oozes oomph in bikinis and sarees
Photos: Kareena Kapoor Khan's grand birthday bash
Photos: 'Dangal' girls Sanya Malhotra, Fatima Sana Shaikh's dinner outing