Rescue teams battled through the night to find survivors after a powerful quake ravaged Peru's central coast, killing some 500 people in one of the country's worst natural disasters in the last 100 years.

The 8.0-magnitude quake struck late on Wednesday and many of its victims were poor, killed when their flimsy mud-brick homes caved in. Hospitals and morgues were overwhelmed, forcing residents to lay bodies out on city streets.

Some 510 people have been confirmed dead and 1,000 wounded in the quake, the United Nations said on Friday, quoting national and local authorities.

The United Nations report, obtained by Reuters in Geneva, said the situation was worst in the cities of Canete, Chincha and Pisco, although other areas like Nazca and Palpa were inaccessible.

The Peruvian government, which has appealed for shelter items and medicines, will present a more detailed assessment of needs later on Friday, according to the report by the U.N. Office for the Coordination of Humanitarian Affairs (OCHA).

More than 24 hours after the quake, a series of aftershocks sowed panic in the hardest-hit towns, south of the capital Lima, although the rescue of a man from the rubble of a collapsed church brought some hope to rescuers in the town of Pisco.

This is virtually a miracle, hopefully we can find more, said Carlos Cordova Gomez, chief of Peru's voluntary firefighters, who worked under floodlights to dig through the church ruins alongside police, soldiers and volunteers.

For the time being we're going to keep on looking for bodies, said Felipe Aguilar, directing Army rescue efforts in the town. For us, this is the priority right now, because we've already pulled one person out alive.

In the square where the devastated church once stood, hundreds of residents gathered in the only part of the town of 120,000 with any light after the quake, which cut electricity and phone lines and cracked major highways.

Pisco, famous for the grape liquor that bears its name, was worst affected by the quake along with the towns of Ica and Chincha, where hundreds of prisoners escaped from a jail when the tremor tore the old building apart.

President Alan Garcia visited the quake-hit areas on Thursday and sent condolences to the families of the victims.

Wednesday's quake was one of the worst natural disasters to hit the South American country during the last century. In 1970, an earthquake killed an estimated 50,000 Peruvians in catastrophic avalanches of ice and mud that buried the town of Yungay.

In downtown Lima, the Peruvian flag flew at half-mast as Garcia declared three days of national mourning.