Under the Ming dynasty (1368-1644), China's population and economy grew. While the Portuguese were at first successfully kept out, Japanese pirates began to attack the coast, forcing co-operation with the Portugues who established a trading settlement at Macau in 1554. Northern Mongol and Jurchen people established a coalition to invade the country, reaching Beijing in 1550. In 1592, the Japanese invaded Korea, while rebellions emerged in China.