The region is first known to have been occupied by humans during the Neolithic period, about 6,000 years ago. Early Hong Kong settlers were a semi-coastal people who migrated from inland and brought knowledge of rice cultivation. The Qin dynasty incorporated the Hong Kong area into China for the first time in 214 BCE, after conquering the indigenous Baiyue. The region was consolidated under the Nanyue kingdom (a predecessor state of Vietnam) after the Qin collapse, and recaptured by China after the Han conquest. During the Mongol conquest, the Southern Song court was briefly located in modern-day Kowloon City (the Sung Wong Toi site) before its final defeat in the 1279 Battle of Yamen. By the end of the Yuan dynasty, seven large families had settled in the region and owned most of the land. Settlers from nearby provinces migrated to Kowloon throughout the Ming dynasty. The earliest European visitor was Portuguese explorer Jorge Álvares, who arrived in 1513. Portuguese merchants established a trading post called (Tamão) in Hong Kong waters, and began regular trade with southern China. Although the traders were expelled after military clashes in the 1520s, Portuguese-Chinese trade relations were reestablished by 1549. Portugal acquired a permanent lease for Macau in 1557.