PADANG, Indonesia — Rescue workers, friends and family members frantically searched for survivors of a major earthquake for a second straight night, many of them using nothing but flashlights, as the death toll continued to rise here in West Sumatra.

Coordinators of the rescue effort have predicted there could be more than 1,000 killed by the quake, which struck Wednesday evening. A smaller, second earthquake rocked the region Thursday morning, just as residents and rescue workers were waking up to see the devastation around them.

In Padang, the capital of West Sumatra, officials confirmed Thursday that more than 400 bodies had so far been pulled from wrecked buildings. Hundreds more, they said, were still trapped.

In Pariaman, the closest village to the epicenter of the first quake, which measured a magnitude 7.6, police said about 200 people had been killed, many of them buried by a series of landslides dislodged by the earthquake. One villager from the area said the majority of the houses there had been flattened.

Police also said there were areas of West Sumatra where rescue workers had not yet been able to reach, indicating the damage could be even more widespread than originally thought.

A military spokesman said a thousand troops has been flown in Thursday to help in the rescue effort, while the finance ministry said $26 million in cash aid had been approved for the thousands who had lost their homes. In many cases using only their hands, rescue workers scoured hundreds of felled buildings in the capital, including one large hotel that had totally collapsed, trapping almost a hundred people inside.

Rescue workers and aid began arriving in large numbers Thursday afternoon, but many residents were still left to search on their own. Outside a collapsed office building in the city’s center, colleagues sifted through debris, looking for coworkers.

“I’m scared. I don’t know what to do. My friend is still trapped inside,” said Yudi, 20, who said he escaped minutes before the building collapsed. “Everyone was panicking, trying to rescue themselves. But some people didn’t make it out in time.”

Complicating the relief effort, Padang’s main hospital, called Djamil, is now in ruins, along with several other smaller ones. At Djamil, patients slept beneath makeshift tents in the parking lot, many of them on the ground. At another private hospital, many of the injured stayed indoors despite huge, jagged cracks in the walls and roof.

A large section of the parking lot at Djamil has been reserved for the deceased, but bodies were being left wherever there was space. Family members shrieked and sobbed as police lined up scores of bodies near the front of the hospital for them to identify. A large crowd of residents surrounded the bodies, standing on curbs, boxes and cars, anxiously trying to get a look at the faces of the dead.

Meanwhile, ambulances sped in and out, dropping off more and more injured and dead. Nurses and doctors there were fast running out of supplies, which were strewn all over the parking lot. As the day wore on, exhausted hospital staff were unable to immediately treat many of the seriously injured.

Thousands in this city of almost 1 million people began panicking all over again Thursday afternoon after hearing rumors that a massive aftershock was imminent. Local folklore says a major earthquake will hit the region every 200 years, and many think Wednesday’s tremblor was only the beginning. As such, residents rushed the few still functioning gas stations, stockpiling fuel for their cars, motorbikes and generators. Long lines of traffic waiting for fuel blocked major roadways, blocking ambulances and other rescue vehicles. Residents were also snatching up fruits and vegetables at a large streetside market, much of which had partially collapsed, ignoring a raging fire that was quickly spreading throughout the wooden shops.

Survivors stayed outside all day and were preparing to spend a second night sleeping outdoors, often on the side of the road in front of their shops and houses. As night fell, many residents sat around small campfires, while the majority of Padang remained without electricity or cell phone coverage.

Disaster management officials in Jakarta said it could be up to four days before electricity returned to the area.