The Ili River Treaty was a treaty between the warring eastern and western parts of the Western Turkic Kaganate that concluded the civil war between warring parties. It split the Western Turkic Kaganate into independent states, with a power structure that guarranteed participation of the constituent tribes in the governance of the their states.
The Ili river treaty of 638 CE is named after the Ili river, it formalized a division of the Western Turkic Kaganate (582-659 CE) into independent states with the border between two states fixed along the Ili river. The splinter resolved a conflict started with re-districting of 634 CE, which re-distributed the Kaganate lands between constituent tribes, with a strong bias on favor of the eastern tribes. A leading role in the conflict and ensuing war played Ezgil leader Kül-erkin, who initiated and participated in summoning the most important officials of the state to a kurultai to demote the Kagan Terish and to raise Yukuk-shad as a Supreme Kagan. After the treaty, the head of the Western Turkic Kaganate Terish-kagan (634-638) retained control of the eastern part of the Kaganate, and the western part was headed by Yukuk Shad of the royal Ashina clan, who became a Kagan of the "western surnames", with a throne name Yelbi-Turuk-Kagan. Separation of the Western Turkic Kaganate set a stage for the later emergence of the Turgesh Kaganate (699-766) of the Western Türks.