The Ly dynasty fought wars against the weakening Champa state and the eventual conquest of Cham territory greatly increased size of the emerging Vietnamese state. This conquest accompanied by an aggressive policy of colonization that imposed northern social and political structures onto the newly settled territories, destroying the Cham civilization. A chain of homogenous villages was built that stretched from the Chinese border to the Gulf of Thailand and consolidated the area under Ly dynasty rule.
By the 13th Century, the Ly dynasty was weakened and was overthrown by rebels who founded the Tran dynasty in 1226. By 1260, however, the Tran's found themselves fighting again against a far greater threat, Kublai Khan and the Mongols from China. Eventually, Kublai Khan was defeated and aggression between Champa and Vietnam resumed as the Chams took advantage of the turmoil brought by the mOngol invasions to revolt. By the end of the 1300s, the Tran Dynasty had succeeded in checking the advances of the now weakened Chams, only to face its own internal problems.
In 1400, Ho Qui Ly, the regent of the child king, usurped the throne and established the Ho Dynasty. In 1407, when the ousted Trans asked for assistance from the Ming Dynasty of China, the Chinese used this request as an excuse to invade the Red River Delta and set up a Chinese administration which lasted for 14 years. During this time, they destroyed all libraries and archives.