李孝恭
At the founding of the Tang empire, Kui Prefecture was known as Xin Prefecture (信州, or Xinzhou). Li Xiaogong (formerly the Duke of Zhao Commandery and Emperor Gaozu's distant nephew) was the Tang general assigned there as commandant, after having helped establishing the Tang dynasty in 618. Other famous people connected with political and military events in the history of Kui Prefecture include Tang General Li Jing, who was sent there by Emperor Tang Gaozu, in 619, in order to pursue military operations versus Xiao Xian of Liang and the Eastern Turkic Khaganate. The Tang forces led by Li Jing were unsuccessful in their attempted invasion, being both beset by "bandits" and being turned back at the heavily defended border of the neighboring empire. And in spring 620, Ran Zhaoze () the leader of the Kaishan Tribe (), rebelled against Tang rule and attacked Kui Prefecture. When the imperial relative Li Xiaogong fought Ran, he was initially unsuccessful, but Li Jing reinforced him with 800 men and defeated and killed Ran, reconsolidating Kui Prefecture into the area of Tang imperial control.