In 618 the Tang Dynasty gained control of China and of Northern Vietnam, changing the name of the country to Annam (Pacified South) in 679 to reflect its status as a part of Southern China. During the T'ang period, a number of individuals tried to revolt against this new and more intrusive government. In 687, Ly Tu Tien and Dinh Kien led an insurrection. In 722, Mai Thuc Loan, also known as the Black Emperor, attempted to become emperor of Vietnam. With the help of Vietnamese neighbors, the Khmers and Chams, he was able to capture the capital for a short time. Further rebellions were started by Phung Hung during the period from 767 to 791 and Duong Thanh in 819 to 820. These rebellions preceded a period of anarchy which occurred both in China and Vietnam in the 10th century with the collapse of the Tang dynasty.