Nam tiến ("southward advance") was the Đại Việt's millennium-long expansion to the south after independence. The first phase was against Champa: from the eleventh to the fourteenth century the two states fought without pause; in 1471 Lê Thánh Tông shattered Champa and took its capital Vijaya, reducing it to a vassal, and its state ended at the hands of the Nguyễn lords in 1697. The second phase was the settlement of the Mekong delta in the seventeenth and eighteenth centuries: the delta then belonged to a weakened Cambodia, and the Nguyễn lords advanced step by step with military-agricultural colonies; in 1698 Nguyễn Hữu Cảnh established Gia Định prefecture and formally incorporated the region into Vietnam. Chinese immigrants played a great part — Mạc Cửu opened Hà Tiên (the port of Banteay Meas), his son Mạc Thiên Tứ built the seven prefectures, and in 1708 the territory submitted to the Nguyễn lords and became a major trading town. Nam tiến turned Vietnam from a Red River delta state into the S-shaped nation along a thousand kilometres of the eastern Indochinese coast, and the Nguyễn dynasty (1802) inherited the result; the price was lasting tension with the Khmer, the Champa remnant and the highland peoples — a historical structure still at the root of ethnic and territorial questions in mainland Southeast Asia.