Evidence of the earliest established society other than the prehistoric Iron Age Đông Sơn culture in Northern Vietnam was found in Cổ Loa, an ancient city situated near present-day Hà Nội.
According to myth, the first Vietnamese people were descended from the Dragon Lord Lạc Long Quân and the Immortal Fairy Âu Cơ. Lạc Long Quân and Âu Cơ had 100 sons before deciding to part ways. 50 of the children went with their mother to the mountains, and the other 50 went with their father to the sea. The eldest son became the first in a line of early Vietnamese kings, collectively known as the Hùng kings (Hùng Vương or the Hồng Bàng Dynasty). The Hùng kings called their country, located on the Red River delta in present-day northern Vietnam, Văn Lang. The people of Văn Lang were known as the Lạc Việt.
Văn Lang is thought to have been a matriarchal society, similar to many other matriarchal societies common in Southeast Asia and in the Pacific islands at the time. Various archaeological sites in northern Vietnam, such as Đông Sơn have yielded metal weapons and tools from this age. Most famous of these artifacts are large bronze drums, probably made for ceremonial purposes, with sophisticated engravings on the surface, depicting life scenes with warriors, boats, houses, birds and animals in concentric circles around a radiating sun at the center.
Many legends from this period offer a glimpse into the life of the people. The Legend of the Rice Cakes is about a prince who won a culinary contest; he then wins the throne because his creations, the rice cakes, reflect his deep understanding of the land's vital economy: rice farming. The Legend of Giong about a youth going to war to save the country, wearing iron armor, riding an armored horse, and wielding an iron staff, showed that metalworking was sophisticated. The Legend of the Magic Crossbow, about a crossbow that can deliver thousands of arrows, showed extensive use of archery in warfare.
Recent research has unlocked the discovery of artificial circular earthworks in the areas of present day southern Vietnam and overlapping to the borders of Cambodia. These archaeological remains are estimated to be economic, social and cultural entities from the 1st millennium BC
By the 3rd century BC, another Viet group, the Âu Việt, emigrated from present-day southern China to the Red River delta and mixed with the indigenous Văn Lang population. In 258 BC, a new kingdom, Âu Lạc, emerged as the union of the Âu Việt and the Lạc Việt, with Thục Phán proclaiming himself "King An Dương Vương". At his capital Cổ Loa, he built many concentric walls around the city for defensive purposes. These walls, together with skilled Âu Lạc archers, kept the capital safe from invaders for a while. However, it also gave rise to the first recorded case of espionage in Vietnamese history, resulting in the downfall of King An Dương Vương.
In 207 BC, an ambitious Chinese warlord named Triệu Đà defeated King An Dương Vương by having his son Trọng Thủy (Chinese: Zhong Shi) act as a spy after marrying An Dương Vương's daughter. Triệu Đà annexed Âu Lạc into his domain located in present-day Guangdong, southern China, then proclaimed himself king of a new independent kingdom, Nam Việt. Trọng Thủy, the supposed crown prince, drowned himself in Cổ Loa out of remorse for the death of his wife in the war.
Some Vietnamese consider Triệu's rule a period of Chinese domination, since Triệu Đà was a former Qin general. Others consider it an era of Việt independence as the Triệu family in Nam Việt were assimilated to local culture. They ruled independently of what then constituted China's (Han Dynasty). At one point, Triệu Đà even declared himself Emperor, equal to the Chinese Han Emperor in the north.