Annam (Chinese: 安南; pinyin: Ānnán; Vietnamese: An Nam) was the southernmost province of China after the Tang dynasty. Annam is the Vietnamese form of the Chinese name Annan, which means "the Pacified the South" or "to pacify the South", a clipped form of the full name, the "Protectorate General to Pacify the South" Chinese: 安南都護府; pinyin: Ānnán Dūhùfǔ; Vietnamese: An Nam đô hộ phủ. This was one of a number of such protectorates formed by Tang China. Prior to the establishment of the protectorate, the area was known as Jiaozhou (交州, Jiāozhōu) or Jiaozhi (Chinese: 交趾; pinyin: Jiāozhǐ; Vietnamese: Giao Chỉ). The same area is now sometimes known as Tonkin (Chinese: 東京; pinyin: Dōngjīng; Vietnamese: Đông Kinh), the "eastern capital" of the Lê dynasty, now modern Hanoi. Locally, the area is known as Bắc Kỳ (北區), the "northern area".
The territory was conquered for the Qin dynasty by Zhao Tuo after the death of Qin Shi Huang. In the chaos surrounding the Chu–Han Contention, he declared its independence as Nanyue and ruled from Panyu (modern Guangzhou). Jiaozhou was the Han dynasty country subdivision formed from the annexation of this tributary kingdom in 111 BCE and it initially comprised the areas of modern Guangdong, Guangxi, and northern Vietnam.
In 679, the Tang dynasty replaced the Jiaozhou Commandery with the Annam Protectorate as their military government in Jiaozhi, but were not immediately successful because the local people did not recognize the Tang Dynasty and instead led a series of defensive wars against Tang forces. This is known in Vietnam as the "Third Northern Domination" of the country.
The Annam Protectorate was renamed Zhennan Protectorate in 757. It was changed back to Annam Protectorate in 760.
It was to remain Annam for the next 600 years, seemingly living up to its name. Annam was a peaceful territory, and became part of a succession of Chinese kingdoms: Eastern Wu, Jin, Liu Song, Southern Qi, Liang, Chen, Sui and the Tang. However, there were still revolts from time to time and periods of weaker government control.
Finally in 939, Ngô Quyền successfully expelled the Chinese at the Battle of Bạch Đằng where he beheaded the Commanding Admiral and Prince of the Southern Han dynasty, Liu Hongcao (劉弘操) and re-established the independent state of Đại Việt. This was the effective end of Annam as a Chinese province. Several attempts were made by various Chinese governments to retake Vietnam, with one succeeding (Ming rule of Vietnam) but only for 20 years (1407–1427).