MEXICO CITY — Just five days before a powerful earthquake struck last year, a history teacher at a Mexico City school gave a lecture about the capital’s propensity for this sort of natural disaster.

The talk was part of the school’s commemoration of the anniversary of the 1985 earthquake, which killed about 10,000 people. The teacher, Fernando Flores, 41, wanted to drive home the point that the destruction was caused not only by Mexico’s geology, but also by the human errors — corruption, the skirting of rules or a flawed bureaucracy — that can disrupt enforcement of building codes.

From where he gave his lecture, he could see right into the classroom of his oldest son, Santiago, a second grader at the school, the Enrique C. Rébsamen school.

“He kept standing up and waving every chance he got,” Mr. Flores said of Santiago.

When a 7.1 earthquake struck early the next week, on Sept. 19 — exactly 32 years after the 1985 quake — it took down thousands of buildings and killed nearly 369 people in the central region of Mexico.