The Zhou Dynasty lasted from 1045 BC to 256 BC in ancient China. During this almost 800 year period, the Zhou Dynasty established itself as the longest ruling dynasty by developing a stable political system with many emperors. Farming was the main economic activity and adopted a feudal structure. New philosophies like the Mandate of Heaven, Taoism, and Confucianism emerged. The Zhou military expanded significantly and fought many battles against barbarians. The dynasty transitioned from the Western Zhou to Eastern Zhou periods, which included the Spring and Autumn and Warring States periods, as power decentralized and new states emerged. By the end, only two states remained before the Qin unified China.