The quake struck late Saturday afternoon in a mountainous area of Sichuan province at a depth of around 15 kilometers (9 miles), according to the U.S. Geological Survey.
The China Earthquake Networks Center said the magnitude was 6.3.
One of the two people reported killed was a woman in her 70s struck on the head by falling debris, state-run news agency Xinhua said, citing a local doctor.
Authorities are still trying to assess the extent of the casualties and damage.
The earthquake prompted students to flee from a primary school in the town of Tagong, near the epicenter, and 42 of them were injured in the ensuing rush, Xinhua reported.
Video footage from the region showed panicked people dashing out of buildings as the quake struck.
The area has experienced scores of smaller aftershocks, Xinhua reported.
Authorities say they have sent response teams and relief supplies to the affected region.
Seismic activity frequently affects Sichuan. A devastating earthquake that hit the province in 2008 left more than 87,000 people dead or missing.
By Jethro Mullen