Yami Qaghan was born as Ashina Rangan, he was either son of
Bagha Qaghan or
Ishbara Qaghan. He was a subordinate khagan under
Tulan Qaghan with title of
Tolis Qaghan, ruling eastern tribes. He sent an ambassador to the
Sui dynasty in 597, requesting to marry to a Chinese princess.
Pei Ju saw this as opportunity and told him to kill Tulan Qaghan's
Zhou origin khatun Princess Qianjin (who was styled as Princess Dayi by
Sui dynasty). Princess Qianjin was murdered and Yami was sent Princess Anyi (安义公主) to marry. However, Rangan's ambitious behaviour outraged Tulan Qaghan. Tulan started to gather an invasion party to attack the Sui in 597 and 599, only to be reported to the Emperor beforehand by Rangan on both occasions. As a reaction, Tulan approached
Tardu to combine forces and attack Rangan. The attack was a success and Rangan had to flee to China after his brothers and nephews were killed during the attack. In the winter of 599, he was made Qimin Khagan by Emperor Wen. Meanwhile Princess Anyi died and he was married to
Princess Yicheng, a daughter of Yang Xie (杨谐). The Emperor commissioned
Zhangsun Sheng to build the city of Dali (大利, in modern
Hohhot) to house Qimin's people, and sent an army to protect Qimin. Meanwhile Tulan was killed by his men causing Tardu to assume throne and claim title Bilge Khagan in 599 or 600. In the winter of 601, Emperor Wen commissioned
Yang Su to command an army, in association with Qimin Khagan (Rangan) as to attack
Tardu. == Reign ==