Fires have been reported in buildings across Mexico City and people are trapped after a powerful earthquake struck close to the city, causing massive damage.

An official at the Civil Protection agency confirmed people were underneath the rubble after the 7.1 magnitude quake.

Thousands of people have moved onto the streets to avoid precarious buildings.

The earthquake struck close to the town of Atencingo in the central state of Puebla, 76 miles southeast of Mexico City, the US Geological Survey said.

Photos showed some buildings had collapsed and cars were crushed by debris that had been shaken loose from buildings.

One image showed a multistory building partially collapsed with dozens of rescue workers close by. It is unclear if people were trapped inside.

Other video showed the side of a government building sheering off and falling into the street as bystanders screamed.

In Cuernavaca, a city south of Mexico City, there were unconfirmed reports on local radio of people trapped beneath collapsed buildings.

Mexico City earthquake in pictures Show all 13 1 /13 Mexico City earthquake in pictures Mexico City earthquake in pictures A handout picture provided by the citizen Edgar Cabalceta shows a general view of Mexico City following a magnitude 7.1 earthquake, in Mexico City, Mexico EPA Mexico City earthquake in pictures Rescuers and residents look for victims amid the ruins of a building knocked down by a magnitude 7.1 earthquake that jolted central Mexico damaging buildings, knocking out power and causing alarm throughout the capital on September 19, 2017 in Mexico City, Mexico. The earthquake comes 32 years after a magnitude-8.0 earthquake hit on September 19, 1985 Getty Images Mexico City earthquake in pictures A police officer stands guard near a building which collapsed after a quake rattled Mexico City RONALDO SCHEMIDT/AFP/Getty Images Mexico City earthquake in pictures Rescuers, firefighters, policemen, soldiers and volunteers remove rubble and debris from a flattened building in search of survivors after a powerful quake in Mexico City AFP/Getty Images Mexico City earthquake in pictures Rescuers and residents look for victims amid the ruins of a building knocked down by a magnitude 7.1 earthquake that jolted central Mexico damaging buildings, knocking out power and causing alarm throughout the capital on September 19, 2017 in Mexico City Getty Images Mexico City earthquake in pictures People try to rescue survivors from a collapsed buildings after a magnitude 7.1 earthquake on the Richter scale in Mexico City, Mexico, 19 September 2017. At least 79 people lost their lives in the states of Morelos, Puebla and Mexico by the earthquake of magnitude 7.1 on the Richter scale. EPA Mexico City earthquake in pictures People clear rubble after an earthquake hit Mexico City, Mexico REUTERS Mexico City earthquake in pictures People clear rubble after an earthquake hit Mexico City, Mexico REUTERS Mexico City earthquake in pictures Rescuers and residents assists an injured victim amid the ruins of a building knocked down by a magnitude 7.1 earthquake that jolted central Mexico damaging buildings, knocking out power and causing alarm throughout the capital on September 19, 2017 in Mexico City, Mexico. The earthquake comes 32 years after a magnitude-8.0 earthquake hit on September 19, 1985. Getty Images Mexico City earthquake in pictures People remove debris outside a collapsed building after an earthquake in Mexico City, Mexico REUTERS Mexico City earthquake in pictures People remove debris as they search for possible victims after a quake rattled Mexico City on September 19, 2017. A powerful earthquake shook Mexico City on Tuesday, causing panic among the megalopolis' 20 million inhabitants on the 32nd anniversary of a devastating 1985 quake. The US Geological Survey put the quake's magnitude at 7.1 while Mexico's Seismological Institute said it measured 6.8 on its scale. The institute said the quake's epicenter was seven kilometers west of Chiautla de Tapia, in the neighboring state of Puebla. AFP/Getty Images Mexico City earthquake in pictures A security guard walks over debris of a building which collapsed during a quake in Mexico City AFP/Getty Mexico City earthquake in pictures Reconstruction work in the towns affected by the telic movement has begun. Several temples suffered severe damage. Rex

The quake came just over a week after another major quake shook the country.

Mexican TV and social media showed cars crushed by debris. Many people fled into the streets, and electricity and phone lines were down in parts of the capital.

"We got out really fast, leaving everything as it was and just left," said Rosaura Suarez, as she stood with a crowd on the street.

The quake hit only hours after many people participated in earthquake drills around the nation on the anniversary of the devastating quake that killed thousands in Mexico City in 1985.

Many people were also still shaken from the recent quake on 7 September, a powerful 8.1 tremor that killed at least 98 people.