The Chimor kingdom was established around 900 CE and it was the last Peruvian kingdom to resist the Incas, defeated by the Inca emperor Topa Inca Yupanqui in 1470. The kingdom of Chimor was not located in the highlands of Peru but instead in the narrow strip of coastland, much of it desert, along the Pacific Ocean. Chimor society was sharply hierarchical and divided into four social classes. People survived thanks to fishing and thanks to the irrigation systems they built which made agriculture possible. They worshiped the moon, not the sun, like the Incas. The Chimor kingdom has left remnants in the form of black ceramics, are known for their exquisite metalwork and for the textiles spun from alpaca wool. The capital of Chan Chan was a great center for artisans and craftsmen.