When Sultan Selim I, after defeating Shah Ismail I in 1514, annexed Western Armenia and Kurdistan, he entrusted the organisation of the conquered territories to Idris, the historian, who was a Kurd of Bitlis. He divided the territory into "sanjaks" or districts, and, making no attempt to interfere with the principle of heredity, installed the local chiefs as governors. He also resettled the rich pastoral country between Erzerum and Erivan, which had lain in waste since the passage of Timur, with Kurds from the Hakkari and Bohtan districts. For the next centuries, from the Peace of Amasya until the first half of the 19th century, several regions of the wide Kurdish homelands would be contested as well between the Ottomans and the neighbouring rival successive Iranian dynasties (Safavids, Afsharids, Qajars) in the frequent Ottoman-Persian Wars.