The Mexican Interior Ministry announced on Twitter it has imposed a state of emergency to deal with the aftermath of the earthquake.

Twenty children and two adults died in a destroyed elementary school in Mexico City, Mexico’s president, Enrique Peña Nieto, told FORO TV, as he visited the school. Thirty children remain uncounted for, he added.

With the rescue operation in the school still under way, the death toll may rise. There have been reports in local media that at least 22 children were killed when the building collapsed.

About 500 military servicemen and 200 members of civil protection units are working at the site, the president said.

Thousands of people were seen fleeing their shaking homes.

Center of Mexico City right now after 7.4 earthquake. Scary. Hope folks are ok. Video shot by a friend in DF pic.twitter.com/tlYtpEShcB

Videos and pictures are being posted online from Mexico City, capturing the tremors and crowds in the streets. The moments when buildings crumbled and people ran for their lives were captured in video footage.

A video posted on Twitter shows a building going up in flames following a powerful explosion.

“People are really scared right now,” said Claudia Meneses, who was at work in a clinic in a Mexico City neighborhood when the quake hit, Reuters reported. She said that as she saw a nearby building collapse, she rushed outside to help those who might have been affected.

Panicked residents were forced to leave belongings behind as they escaped buildings in danger of collapse.

“We got out really fast, leaving everything as it was and just left,” Rosaura Suarez, a local resident, told Reuters.

Mexico City’s metro and public transport systems announced they were offering free rides to passengers on all lines.

Nieto said he has called a meeting of the National Emergency Committee to coordinate relief efforts and assess the damage, adding that that he activated the MX Plan, a response plan designed for major emergencies.

As result of the quake, some 3.8 million people have been left without power, Mexico's Federal Commission of Electricity reported on Twitter.

A civil protection official told local TV that the earthquake has led to fires in buildings across the City of Mexico, with some people trapped inside.