Since the Qin dynasty (221–206 BC), the ancestors of the Hakka people have migrated southwards several times because of social unrest, upheaval and invasions from the northern provinces (e.g. Gansu, Henan). Subsequent migrations also occurred at the end of the Tang dynasty in the 10th century and during the end of the Northern Song dynasty in the 1120s, the last of which saw a massive flood of refugees fleeing southward when the Jurchens captured the northern Song capital of Bianliang (modern-day Kaifeng) in the Jingkang Incident of the Jin–Song Wars. The precise movements of the Hakka people remain unclear during the 14th century when the Ming dynasty overthrew the Yuan dynasty and subsequently fell to the Manchus who formed the Qing dynasty in the 17th century.