Updated

Rescuers raced Tuesday to evacuate villages near rising lakes formed by landslides, complicating relief efforts following a strong earthquake in southern China that killed at least 398 people and has left thousands homeless.

Rescue teams have freed dozens of trapped survivors as they dig through the thousands of homes that collapsed when the tremor struck impoverished Ludian county in Yunnan province on Sunday. A 5-year-old boy freed by hand-digging Monday was among the 32 people rescued in the first two days, the official Xinhua News Agency reported.

Landslides have created barrier lakes where water levels were rising Tuesday to pose a new threat to about 800 residents and seven power stations downstream, where sudden flooding could prompt widespread power outages, Xinhua reported.

A main road into the worst-hit areas of Ludian was clogged Tuesday with bulldozers, backhoes and civilian and military vehicles carrying supplies including water and instant noodles.

Further into the quake zone, survivors, including some half-naked, were sitting along muddy roads in the rain waiting for food and medication, Xinhua said. Medics were reporting severe shortages of medicine and an inability to perform operations on the severely injured, while rescuers said their work had been hampered by continuous downpours and quake-triggered landslides, Xinhua said.

The quake struck about 4:30 p.m. on Sunday about 230 miles northeast of the Yunnan provincial capital of Kunming.  Overhead footage of the quake zone shot by state broadcaster CCTV showed older houses flattened but newer multistory buildings still standing.

Ma Yaoqi, an 18-year-old volunteer in the quake zone, said by phone that at least half of the buildings had collapsed on the road from the city of Zhaotong to the hardest-hit town of Longtou. The rest of the buildings were damaged, she said.

"I saw dead bodies being wrapped in quilts and carried away," said Ma, who arrived with 20 other volunteers Monday. "Some were wrapped with small quilts. Those must be kids."

The magnitude-6.1 quake struck at a depth of 6 miles, according to the U.S. Geological Survey. China's earthquake monitoring agency put the magnitude at 6.5.

The Yunnan Civil Affairs Bureau said on its website that 398 people were killed, three were missing and a further 1,801 injured. About 230,000 people had been evacuated.

The central government has allocated 600 million yuan ($97 million) for rescue and relief work after the quake, the Finance Ministry said.

Many of the homes that collapsed in Ludian, which has a population of about 429,000, were old and made of brick, Xinhua said, adding that electricity and telecommunications were cut off in the county.

The mountainous region where the quake occurred is largely agricultural, with farming and mining the top industries, and is prone to earthquakes.

More than 2,500 troops were dispatched to the disaster region, Xinhua said. The government also sent thousands of tents, quilts, sleeping bags, cotton coats, folding beds, chairs and tables, and 50 mobile toilets, Xinhua said.

Chinese Premier Li Keqiang reached the worst-hit area Monday afternoon to oversee quake relief, state media reported.

In 1970, a magnitude-7.7 earthquake in Yunnan killed at least 15,000 people, and a magnitude-7.1 quake killed more than 1,400 in 1974. In September 2012, 81 people died and 821 were injured in a series of quakes in the region.

In May 2008, a powerful quake in Sichuan province left nearly 90,000 people dead.