The Tang took control of the northern Vietnamese region of Jiaozhi (Giao Châu; roughly corresponding to the area of the modern Red River Delta) after 618 and established twelve provinces and 59 districts under the Protectorate of Annam (). This control lasted until the 10th century, when Khúc Thừa Dụ took over as "tiết độ sứ" or "jiedushi" in 905. By 906 an autonomous region in Vietnam was established under the Khúc clan in Tống Bình (near modern-day Hanoi) in 906, paving way for total independence from China under Ngô Quyền.