The Incan ruins of Pisac once served as military, religious and agricultural functions. Militarily, Pisac was thought to be the southern defense of the Sacred Valley (which includes Machu Picchu). To produce food in an inhospitable climate of high altitude, rich top soil from the valley was hauled up the trail to the raised terraces. The angle of the Temple of the Sun suggests its purpose was astronomical, but the Spanish destroyed the temple less than a hundred years after it was constructed, leaving historians and astronomers in the dark.