A strong, shallow earthquake that shook southwestern China overnight killed at least one person, damaged buildings and prompted thousands to camp outside as aftershocks continued to strike the area, officials said Wednesday.

The earthquake with a magnitude of at least 6.0 struck the Weiyuan city area of Yunnan province at 9:49 p.m. Tuesday when most residents would have been in their homes. At least 324 people were injured, eight of them seriously, the Yunnan provincial government said.

"The whole building was shaking terribly with a loud cracking sound. Plates fell off in the kitchen," the official state Xinhua News Agency quoted Weiyuan resident Li Anqin as saying.

"We all ran out and the streets now are packed with people," Li said.

Xinhua said nearly 7,000 buildings were destroyed.

The U.S. Geological Survey said the earthquake measured magnitude 6.0 and was centered at a depth of 10.1 kilometers (6.3 miles). Its shallow focus was likely to cause greater damage, but there were no immediate reports of serious destruction.

China's national earthquake monitoring agency gave the quake's magnitude as 6.6 and said it struck just 5 kilometers (3.1 miles) below the surface. It said the quake was followed by eight aftershocks, the strongest of which registered magnitude 4.2.

Chinese Premier Li Keqiang ordered an "all-out effort" to rescue quake victims, ensure the delivery of food, water and other supplies, and fix disruptions to transportation and communications.

Worst hit was the town of Yongping, 5 kilometers (3 miles) from the epicenter, where some houses had collapsed, Xinhua said.

Yongping has a population of 54,000, while the surrounding county of Jinggu closest to the epicenter has a population of 290,000.

Residents of a community near a 5-square kilometer (2-square mile) reservoir in Jinggu were evacuated after the reservoir's dam was found to have an 8-centimeter-wide (3-inch-wide) crack that was leaking water following the quake. Officials were assessing the risk to the dam and seeing about repairs, said a Jinggu county official who gave only his surname, Yao.

Xinhua said strong tremors were felt in the provincial capital, Kunming, about 360 kilometers (220 miles) to the northeast. It said an initial 230-member rescue team was dispatched to the quake area within two hours of its striking.

A state television reporter in the city of Pu'er, about 85 kilometers (53 miles) from the epicenter, said people fled buildings and were camping outdoors in anticipation of more aftershocks. The reporter, Wang Jian, said there was damage to structures and the local cellphone network.

The remote mountainous region near the border with Myanmar is prone to earthquakes. A 6.1-magnitude quake in northern Yunnan in August killed at least 615 people and left more than 100 others missing. In 1970, a magnitude-7.7 earthquake in Yunnan killed at least 15,000 people.