The capital, whose sprawling metropolitan area is home to more than 20 million people, has been blanketed in a thick layer of smog since Saturday.

Authorities say the problem is dozens of wildfires that have broken out this month on the city's outskirts, combined with hot, dry, windless weather that has caused the resulting air pollution to stagnate overhead.

"Contamination levels remain high, and the weather forecast indicates that conditions for dispersing the contaminants will remain unfavorable," the education ministry said in a statement announcing the cancellation of all primary and middle school classes for Thursday.

Public daycares were ordered to remain closed, as well.

The country's largest university, UNAM, and the National Polytechnic Institute also cancelled classes.

The Mexican football league said that, acting under the advice of the authorities, it decided to relocate the first leg of the first-division semi-final between Leon and Mexico City club America to the city of Queretaro, some 200 kilometers (125 miles) to the northwest.

It had already postponed the match from Wednesday to Thursday because of the polluted air. A baseball game was also postponed.

Authorities called on residents to avoid physical activity outdoors, and urged the elderly and those with respiratory illnesses to remain inside.

They hammered home the message by closing several parks widely used for jogging, walking and cycling, including the city's largest, the Bosque de Chapultepec.

They have also ordered cars with certain license plate numbers off the road, shut down construction sites larger than 5,000 square meters (55,000 square feet), and ordered certain polluting industries to cut their emissions by 30 to 40 percent.

Mayor Claudia Sheinbaum said firefighters battled 22 fires on Wednesday alone, of which six were still burning.

Mexico City is naturally prone to air pollution: it is surrounded by a ring of mountains that often trap smog over the capital, preventing it from dissipating.

Polluting industries and the more than five million cars on the city's streets only make matters worse.