From the 11th to 13th centuries, the independence of the Vietnamese Kingdom (Dai Viet) was consolidated under the emperors of the Ly Dynasty, founded by Ly Thai To in 1009. The emperors of this dynasty reorganized the administrative system, founded the nation's first university (The Temple of Literature in Hanoi), promoted agriculture and built the first embankments for flood control along the Red River. During the Ly Dynasty, the Chinese, Khmers, and Chams repeatedly attacked Vietnam, but were repelled, most notably under the renowned strategist and tactician Ly Thuong Kiet (1030-1105), a military official of royal blood who is still revered as a national hero.