A 7.4-magnitude earthquake rocked southwestern Guatemala on Wednesday, killing 48 people and injuring another 150 while more were missing as homes crumbled.

The earthquake also rattled nerves in neighbouring Mexico and El Salvador, sparking a tsunami alert on the Salvadoran coast and evacuations from offices, homes and schools as far north as Mexico City.

"We have to lament the death of 48 people, a figure that could rise because we still have 23 missing people," President Otto Perez said in the capital after visiting the disaster area. He had earlier reported 39 deaths.

Perez said 39 of the victims were in San Marcos department, located at the border with Mexico and some 250 kilometers west of Guatemala City. The nine others were in two other regions that are also majority Maya.

In the village of San Cristobal Cucho, an entire family of 10 died when their home was buried in rocks and earth that slid from a hill after the earthquake, Mayor Pedro Cardona said.

"The whole village is in mourning because an entire family was taken by God's nature," he told local television. "What can we do?"

The bodies of a couple, their six children ages four to 15 and two other family members still on the street into the night, awaiting to be put in coffins.

Some 16,000 people were affected by the earthquake, Perez said. Several towns lacked drinking water or electricity in the country's most violent earthquake since 1976, when almost 23,000 people perished.

Authorities opened 11 shelters that can house 800 people.

The city of San Marcos, a town dotted with colonial-style, single-floor homes, was pitch black while the main street was covered in debris. Older homes were in pieces but newer ones withstood the shock.

Several aftershocks rattled residents, who used lamps to look for pillows and covers in what was left of their homes to keep warm during the night.

Rescuers workers and residents dug into a sand quarry in a desperate search for survivors. "We feel powerless in front of this quantity of sand, which fell on people, and not being able to dig them out quickly," 30-year-old social worker Alfonso told AFP. "You feel like your hands won't reach people."

Tsunami alert

In El Salvador, President Mauricio Funes ordered evacuations in western coastal towns following a tsunami alert but the waves never materialised.