At the beginning of the global Post Classic Period, the city of Teotihuacan was at its zenith, housing over 125,000 people, at 500 A.D it was the sixth largest city in the world at the time. The city's residents built the Pyramid of the Sun the third largest pyramid of the world, oriented to follow astronomical events. Suddenly in the 6th and 7th centuries, the city suddenly declined possibly as a result of severe environmental damage caused by extreme weather events of 535–536. There is evidence that large parts of the city were burned, possibly in a domestic rebellion. The city's legacy would inspire all future civilizations in the region.