manufacturing industries were privatised. The emergence of rural and urban markets, where production was geared towards consumption, was a key development in this era. China's growing wealth in this era lead to the loss of martial vigour; the era involved two periods of native rule, each followed by periods of alien rule. By the end of the isolationist Manchu Qing dynasty (1664–1911), China's development slowed, falling behind that of the west. The food production grew thanks to more lands being cultivated and to the increasing yields. The production of iron and salt and other commodities also grew in this period. According to the GDP estimates by Broadberry et al., the per capita GDP was stable during the Song and Ming dynasties before going down during the Qing dynasty when the population increase outstripped the GDP growth. Thus Song China was the richest country in the world by GDP per capita at the turn of the millennium, by the 14th century parts of Europe caught up with it and the significant gap between China and Europe appeared by the middle of the 18th century. Song dynasty (960–1279) In 960, the Later Zhou general Zhao Kuanyi overthrew his imperial master and established the Song dynasty, the sixth in fifty-three years. Nineteen years later, he had reunified most of China. This was one of the most prosperous periods in Chinese history. Unlike its predecessors, the monarchy and aristocracy weakened under the Song, allowing a class of non-aristocratic gentry to gain power. The central government withdrew from managing the economy (except during Wang Anshi's chancellorship and the Southern Song), provoking drastic economic changes. Technological advances encouraged growth; three of the so-called Four Great Inventions: gunpowder, woodblock printing, and the compass, were invented or perfected during this era. The population rose to more than 100 million during the Song period. However, the Song eventually became the first unified Chinese dynasty to be completely conquered by invaders. Song industry During the 11th century, China developed sophisticated technologies to extract and use coal for energy, leading to soaring iron production. Iron production rose fivefold from 800 to 1078, to about 125,000 English tons (114,000 metric tons), not counting unregistered iron production. Initially, the government restricted the iron industry, but the restrictions on private smelting was lifted after the prominent official Bao Qingtian's (999-1062) petition to the government Production of other metals also soared; officially registered Song production