The quake struck the county of Qingchuan at 5:49 p.m. local time (9:49 GMT), with its epicenter 50 km (30 miles) northwest of Guangyuan town, the agency said. No details on casualties or damage have yet been released.
The latest earthquake occurred just hours after the Olympic torch relay was held in the Sichuan capital of Chengdu. This was the last stop before the start of the Beijing Games on Friday.
The aftershock comes less than three months after the province was hit by China's worst earthquake in three decades, measuring 8.0 on the Richter scale. At least 70,000 people were killed and 10 million displaced.
The May 12 quake, which affected more than 47,000 villages, left some 1.4 million people in remote communities completely impoverished. China's direct economic losses from the earthquake have been put at more than 1 trillion yuan (around $150 billion).