Guatemala quake – witnesses reported seeing people buried in some of the 30 houses that collapsed in the town of San Marcos, near Mexico. Photograph: EPA

A 7.4-magnitude earthquake struck off the Pacific coast of Guatemala on Wednesday morning, killing at least 45 people, according to the country's president.

Otto Pérez Molina told a news conference not all the deaths had been confirmed, but witnesses reported seeing people buried in some of the 30 houses that collapsed in the town of San Marcos, near the north-western border with Mexico, where most of the damage was reported.

The quake, which was about 20 miles deep and centred 15 miles off the coastal town of Champerico and about 100 miles south-west of Guatemala City, shook buildings as far away as Mexico City and El Salvador.

Survivors on radio and social media talked of widespread landslides and scores of people trapped. But accounts of injuries and deaths were difficult to independently confirm as communication and roads to San Marcos had been severed.

It was the largest earthquake to strike Guatemala since 1976, when 23,000 people were killed during a similar disaster in the small central American country.

"I've been in Guatemala for almost two years I am used to earthquakes. This was a lot more severe, a lot more shaky," said a Peace Corps volunteer, Adam Baker, 27, of Carmel, Indiana, who tweeted a picture of a small landslide behind his house in the nearby state of Quetzaltenango. "Things fell in my kitchen," it said.

Nicaragua's disaster-management agency said it had issued a tsunami alert, but there were no immediate reports of a high sea wave on the country's Pacific coast.

People fled buildings in Guatemala City, Mexico City and the capital of the Mexican state of Chiapas, across the border from Guatemala.

A reporter in San Marcos, a mostly rural region about 80 miles north of the epicentre, told Emisoras Unidas that houses had collapsed on residents, while smashed televisions and other appliances had been scattered into the streets of the main town.

The local fire department tweeted that a school had collapsed and eight injured people had been taken to a nearby hospital. Local radio reported widespread power outages and cuts in telephone service.

Molina said in a radio interview that the country of 14 million had been placed on its highest disaster alert and he urged people to evacuate tall buildings as an emergency measure.

The country's minister of communications and infrastructure told Emisoras Unidas that landslides had cut off several highways in the west of the country, and it would take at least 24 hours to re-establish transport links to San Marcos.

A resident, who identified herself as Mrs Baglia, from the small town of San Pedro Sacatepequez near San Marcos, told the radio station that people had fled into the streets after being told of a tsunami alert. "People are in distress and no one can calm down," she said.

A spokesman for El Salvador's Red Cross branch said the quake had been felt throughout the country, sending people fleeing their homes in the capital, but there had been no immediate reports of injuries or serious damage. He said there had been no local tsunami warning issued.

El Salvador's civil protection agency said officials were evacuating some coastal communities as a precautionary measure.

No serious damage or injuries had been reported in the city, the Mexico City mayor said, although many people had fled their offices and homes during the quake.