Tens of thousands of people moved into tents or cars, unable to return home or too afraid to go back as aftershocks continued to jolt the region.
Lushan, where the quake struck, lies where the fertile Sichuan plain meets foothills that eventually rise to the Tibetan plateau and sits atop the Longmenshan fault. It was along that fault line that a devastating magnitude-7.9 quake struck on May 12, 2008, leaving more than 90,000 people dead or missing and presumed dead in one of the worst natural disasters to strike China in recent decades.
"It was just like May 12,'' Liu Xi, a writer in Ya'an city, who was jolted awake by Saturday's quake, said via a private message on his account on Sina Corporation's Twitter-like Weibo service. "All the home decorations fell at once, and the old house cracked.''
The official Xinhua News Agency said the well-known Bifengxia panda preserve, which is near Lushan, was not affected by the quake. Dozens of pandas were moved to Bifengxia from another preserve, Wolong, after its habitat was wrecked by the 2008 quake.
As in most natural disasters, the government mobilized thousands of soldiers and others -- 7,000 people by Saturday afternoon -- sending excavators and other heavy machinery as well as tents, blankets and other emergency supplies. Two soldiers died after the vehicle that they and more than a dozen others were in slipped off the road and rolled down a cliff, state media reported.
Premier Li Keqiang flew to Ya'an to direct rescue efforts, and he and President Xi Jinping ordered officials and rescuers to make saving people the top priority, Xinhua said.
The Chinese Red Cross said it had deployed relief teams with supplies of food, water, medicine and rescue equipment to the disaster areas.
With roads blocked for several hours after the quake, the military surveyed the disaster area by air. Aerial photos released by the military and shown on state television showed individual houses in ruins in Lushan and outlying villages flattened into rubble. The roofs of some taller buildings appeared to have slipped off, exposing the floors beneath them.
A person whose posts to the micro-blogging account "Qingyi Riverside'' on Weibo carried a locator geotag for Lushan said many buildings collapsed and that people could spot helicopters hovering above.
The earthquake administration said there had been at least 712 aftershocks, including two of magnitude-5.0 or higher.
"It's too dangerous,'' said a person with the Weibo account Chengduxinglin and with a Lushan geotag. "Even the aftershocks are scary.''
While rescuers and state media rushed to the disaster scene, China's active social media users filled the information gap. They posted photos of people fleeing to streets for safety and of buildings flattened by the quake. They shared information on the availability of phone services, apparently through data services.