Kayqubad was the second son of Sultan Kaykhusraw I, who bestowed upon him at an early age the title "malik" and the governorship of the important central Anatolian town of Tokat. When the sultan died following the battle of Alaşehir in 1211, both Kayqubad and his elder brother Kaykaus struggled for the throne. Kayqubad initially garnered some allies among the neighbors of the sultanate: Leo I, the king of Cilician Armenia and Tughrilshah, the brothers' uncle and the independent ruler of Erzurum. Most of the emirs, as the powerful landed aristocracy of the sultanate, supported Kaykaus. Kayqubad was forced to flee to the fortress at Ankara, where he sought aid from the Turkman tribes of Kastamonu. He was soon apprehended and imprisoned by his brother in a fortress in western Anatolia.