Đinh Bộ Lĩnh was born in 924 in Hoa Lư (south of the Red River Delta, in what is today Ninh Bình Province). Growing up in a local village during the disintegration of the Chinese Tang Dynasty that had dominated Vietnam for centuries, Đinh Bộ Lĩnh became a local military leader at a very young age. From this turbulent era, the first independent Vietnamese polity emerged when the warlord Ngô Quyền defeated the Southern Han's forces in the First Battle of the Bạch Đằng River in 938. However, the Ngô Dynasty was weak and unable to effectively unify Vietnam. Faced with the domestic anarchy produced by the competition of twelve independent feudal warlords for control of the country, as well as the external threat represented by Southern Han, which regarded itself as the heir to the ancient kingdom of Nan Yue that had encompassed not only southern China but also the Bac Bo region of northern Vietnam, Đinh Bộ Lĩnh sought a strategy to politically unify the Vietnamese. Upon the death of the last Ngô king in 965, he seized power and founded a new kingdom the capital of which was in his home district of Hoa Lư. To establish his legitimacy in relation to the previous dynasty, he married a woman of the Ngô family.
In the first years of his reign, Đinh Bộ Lĩnh was especially careful to avoid antagonizing Southern Han. In 968, however, he took the provocative step of adopting the title of Emperor (Hoàng Đế) and thereby declaring his independence from Chinese overlordship. He founded the Đinh Dynasty and called his kingdom Đại Cồ Việt. His outlook changed, however, when the powerful Song Dynasty annexed Southern Han in 971. In 972, Đinh Bộ Lĩnh ingratiated himself with the Song by sending a tribute mission to demonstrate his fealty to the Chinese Emperor. Emperor Taizu of Song subsequently recognized the Viet ruler as Giao Chỉ Quận Vương (King of Giao Chi), a title which expressed a theoretical relationship of vassalage in submission to the empire. Well aware of Song's military might, and eager to safeguard the independence of his country, Đinh Bộ Lĩnh obtained a non-aggression agreement in exchange for tributes payable to the Chinese court every three years.
In addition to managing relations with China, Đinh Bộ Lĩnh energetically reformed the administration and the armed forces of Vietnam in order to strengthen the foundations of the new state. He established a royal court and a hierarchy of civil and military servants. Đinh Bộ Lĩnh also instituted a rigorous justice system in which treason was punishable by being cooked in a vat of boiling oil or by being fed to a caged tiger, so as to provide a deterrent to all who threatened the new order in the kingdom.
However, Đinh Bộ Lĩnh's reign did not last long. In 979, a palace official, inspired by a dream killed both Đinh Bộ Lĩnh and his eldest son Đinh Liễn while they were sleeping in the palace courtyard. The killer was quickly apprehended and executed by general Nguyễn Bặc. Bộ Lĩnh was succeeded by his six-year-old surviving son Dinh Phe De.
The Song Chinese Emperor wanted to take advantage of the turbulent situation in Đại Cồ Việt in order to reestablish Chinese control over the county, and he sent an army to invade Vietnam. In this crisis, Lê Hoàn, the commander-in-chief of Đinh Bộ Lĩnh's army, stepped into the power vacuum, dethroned the child emperor, eliminated his opponents at court, and entered into illicit relations with the Empress Dowager Dương Vân Nga. Lê Hoàn defeated the Song invasion, proclaimed himself Emperor, and founded the Early Lê Dynasty. He continued to call the country "Đại Cồ Việt."